12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace KeaBundle\Repository;
- class Lease4Repository extends \Doctrine\ORM\EntityRepository
- {
- /**
- * @return array
- */
- public function getAllAddress()
- {
- $qb = $this->createQueryBuilder('Lease4');
- $leases = $qb->getQuery()->getResult();
-
- return array_map(function ($lease) {
- return $lease->getAddress();
- }, $leases);
- }
- /**
- * @param string $hwaddr
- *
- * @return array
- */
- public function getByHwaddr($hwaddr)
- {
- $qb = $this->createQueryBuilder('Lease4')
- ->where('Lease4.hwaddr = :hwaddr')->setParameter('hwaddr', hex2bin($hwaddr));
-
- return $qb->getQuery()->getOneOrNullResult();
- }
- }
|