12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace WorkflowBundle\Repository;
- use \Doctrine\ORM\EntityRepository;
- class Doctrine2WorkFlowActionRepository extends EntityRepository
- {
- /**
- * @param array $criteria
- *
- * @return array
- */
- public function findAllBy($criteria = array())
- {
- $qb = $this->createQueryBuilder('Doctrine2WorkFlowAction');
- foreach ($criteria as $field => $value) {
- $qb->andWhere("Doctrine2WorkFlowAction.{$field} = :{$field}")->setParameter($field, $value);
- }
- return $qb->getQuery()->getResult();
- }
- /**
- * @param string $eventName
- * @param string $entityClass
- *
- * @return array
- */
- public function findAllByEventAndEntityClass($eventName, $entityClass)
- {
- return $this->findAllBy(compact('eventName', 'entityClass'));
- }
- }
|