| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class UserRepository extends EntityRepository |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Finds entities by a set of criteria. |
||
| 20 | * |
||
| 21 | * @param array $criteria |
||
| 22 | * @param array|null $orderBy |
||
| 23 | * @param int|null $limit |
||
| 24 | * @param int|null $offset |
||
| 25 | * |
||
| 26 | * @return array The objects. |
||
| 27 | */ |
||
| 28 | public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) |
||
| 29 | { |
||
| 30 | $criteria = $this->parseCriteria($criteria); |
||
| 31 | return parent::findBy($criteria, $orderBy, $limit, $offset); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Finds a single entity by a set of criteria. |
||
| 36 | * |
||
| 37 | * @param array $criteria |
||
| 38 | * @param array|null $orderBy |
||
| 39 | * |
||
| 40 | * @return object|null The entity instance or NULL if the entity can not be found. |
||
| 41 | */ |
||
| 42 | public function findOneBy(array $criteria, array $orderBy = null) |
||
| 43 | { |
||
| 44 | $criteria = $this->parseCriteria($criteria); |
||
| 45 | return parent::findOneBy($criteria, $orderBy); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return array |
||
| 50 | * @since 1.0 |
||
| 51 | */ |
||
| 52 | protected function parseCriteria(array $criteria) |
||
| 59 | } |
||
| 60 | } |
||
| 61 |