$user->get_id(), ); $query = $this->_em->createQuery($dql); $query->setParameters($params); return $query->getResult(); } /** * * @param \User_Adapter $user * @param type $list_id * @return \Entities\UsrList */ public function findUserListByUserAndId(Application $app, \User_Adapter $user, $list_id) { $list = $this->find($list_id); /* @var $basket \Entities\UsrList */ if (null === $list) { throw new NotFoundHttpException(_('List is not found')); } if ( ! $list->hasAccess($user, $app)) { throw new AccessDeniedHttpException(_('You have not access to this list')); } return $list; } /** * Search for a UsrList like '' with a given value, for a user * * @param \User_Adapter $user * @param type $name * @return \Doctrine\Common\Collections\ArrayCollection */ public function findUserListLike(\User_Adapter $user, $name) { $dql = 'SELECT l FROM Entities\UsrList l JOIN l.owners o WHERE o.usr_id = :usr_id AND l.name LIKE :name'; $params = array( 'usr_id' => $user->get_id(), 'name' => $name . '%' ); $query = $this->_em->createQuery($dql); $query->setParameters($params); return $query->getResult(); } }