@@ -3,15 +3,12 @@ | |||
namespace Lc\SovBundle\Repository\Site; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | |||
use Lc\CaracoleBundle\Repository\StatusRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class NewsRepositoryQuery extends AbstractRepositoryQuery implements NewsRepositoryQueryInterface | |||
{ | |||
use StatusRepositoryQueryTrait; | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(NewsRepository $repository, PaginatorInterface $paginator) | |||
{ |
@@ -42,17 +42,8 @@ class TicketStore extends AbstractStore implements TicketStoreInterface | |||
return $query->find(); | |||
} | |||
// public function findAllOpen($limit = 0) | |||
// { | |||
// $query = $this->findByMerchantQuery(); | |||
// $this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]); | |||
// $query->addOrderBy('e.id', 'DESC'); | |||
// $query->setMaxResults($limit); | |||
// return $query->getQuery()->getResult(); | |||
// } | |||
//countAllOpen | |||
public function countAllOpen($query = null) | |||
public function countAllOpen($query = null): string | |||
{ | |||
if (is_null($query)) { | |||
$query = $this->query->create(); | |||
@@ -63,13 +54,4 @@ class TicketStore extends AbstractStore implements TicketStoreInterface | |||
return $query->count(); | |||
} | |||
// public function countAllOpen() | |||
// { | |||
// $query = $this->findByMerchantQuery(); | |||
// $query->select('count(e.id)'); | |||
// $this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]); | |||
// return $query->getQuery()->getSingleScalarResult(); | |||
// } | |||
} |
@@ -29,11 +29,12 @@ class UserRepository extends AbstractRepository | |||
$this->_em->flush(); | |||
} | |||
public function findByRole($role) { | |||
public function findByRole($role) | |||
{ | |||
return $this->createQueryBuilder('u') | |||
->andWhere('u.roles LIKE :role') | |||
->setParameter('role', '%'.$role.'%') | |||
->getQuery() | |||
->getResult(); | |||
->andWhere('u.roles LIKE :role') | |||
->setParameter('role', '%' . $role . '%') | |||
->getQuery() | |||
->getResult(); | |||
} | |||
} |