for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AppBundle\Repository;
use AppBundle\Entity\User;
/**
* UserRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class UserRepository extends \Doctrine\ORM\EntityRepository
{
public function findUsersWithoutRole($role)
return $this->createQueryBuilder('user')
->andWhere('user.role <> :role')
->setParameter('role', $role)
->getQuery()
// ->getResult()
;
}
public function findChoiceModules($module)
return $this->createQueryBuilder('u')
->where('u.chosenModule LIKE :module')
->setParameter('module', '%"'.$module.'"%')
->getResult();
public function findCountUsers()
->select('COUNT(u.id) as count_u')
->andWhere('u.role = :role')
->setParameter('role', User::ROLE_USER)
->getOneOrNullResult();