@@ -9,6 +9,6 @@ class FileRepositoryQuery extends AbstractRepositoryQuery implements FileReposit | |||
{ | |||
public function __construct(FileRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'file', $paginator); | |||
} | |||
} |
@@ -9,6 +9,6 @@ class NewsletterRepositoryQuery extends AbstractRepositoryQuery implements Newsl | |||
{ | |||
public function __construct(NewsletterRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'newsletter', $paginator); | |||
} | |||
} |
@@ -12,7 +12,7 @@ class ReminderRepositoryQuery extends AbstractRepositoryQuery implements Reminde | |||
public function __construct(ReminderRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'reminder', $paginator); | |||
} | |||
public function filterByDone($done = false): self | |||
@@ -28,7 +28,7 @@ class ReminderRepositoryQuery extends AbstractRepositoryQuery implements Reminde | |||
$this->isJoinUser = true; | |||
return $this | |||
->leftJoin('.users', 'u'); | |||
->leftJoin('.users', 'users'); | |||
} | |||
return $this; | |||
} | |||
@@ -37,7 +37,7 @@ class ReminderRepositoryQuery extends AbstractRepositoryQuery implements Reminde | |||
{ | |||
$this->joinUser(); | |||
return $this | |||
->having('COUNT(u.id) = 0') | |||
->having('COUNT(users.id) = 0') | |||
->orHaving(':user MEMBER OF .users') | |||
->setParameter(':user', $user); | |||
} |
@@ -9,6 +9,6 @@ class SiteSettingRepositoryQuery extends AbstractRepositoryQuery implements Site | |||
{ | |||
public function __construct(SiteSettingRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'siteSetting', $paginator); | |||
} | |||
} |
@@ -10,6 +10,6 @@ class NewsRepositoryQuery extends AbstractRepositoryQuery implements NewsReposit | |||
public function __construct(NewsRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'news', $paginator); | |||
} | |||
} |
@@ -9,7 +9,7 @@ class PageRepositoryQuery extends AbstractRepositoryQuery implements PageReposit | |||
{ | |||
public function __construct(PageRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'page', $paginator); | |||
} | |||
} |
@@ -9,6 +9,6 @@ class SiteRepositoryQuery extends AbstractRepositoryQuery implements SiteReposit | |||
{ | |||
public function __construct(SiteRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'site', $paginator); | |||
} | |||
} |
@@ -10,7 +10,7 @@ class TicketMessageRepositoryQuery extends AbstractRepositoryQuery implements Ti | |||
{ | |||
public function __construct(TicketMessageRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'ticketMessage', $paginator); | |||
} | |||
public function filterByTicket(TicketInterface $ticket) |
@@ -13,7 +13,7 @@ class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRep | |||
public function __construct(TicketRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'ticket', $paginator); | |||
} | |||
public function filterByUser(UserInterface $user): self | |||
@@ -46,7 +46,7 @@ class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRep | |||
$this->joinUser(); | |||
return $this | |||
->andWhere('.visitorFirstname LIKE :firstname OR u.firstname LIKE :firstname') | |||
->andWhere('.visitorFirstname LIKE :firstname OR user.firstname LIKE :firstname') | |||
->setParameter('firstname', $firstname); | |||
} | |||
@@ -55,7 +55,7 @@ class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRep | |||
$this->joinUser(); | |||
return $this | |||
->andWhere('.visitorLastname LIKE :lastname OR u.lastname LIKE :lastname') | |||
->andWhere('.visitorLastname LIKE :lastname OR user.lastname LIKE :lastname') | |||
->setParameter('lastname', $lastname); | |||
} | |||
@@ -64,13 +64,13 @@ class TicketRepositoryQuery extends AbstractRepositoryQuery implements TicketRep | |||
$this->joinUser(); | |||
return $this | |||
->andWhere('.visitorEmail LIKE :email OR u.email LIKE :email') | |||
->andWhere('.visitorEmail LIKE :email OR user.email LIKE :email') | |||
->setParameter('email', $email); | |||
} | |||
public function selectCount(): self | |||
{ | |||
return $this | |||
->select('count(r.id) as count'); | |||
->select('count(ticket.id) as count'); | |||
} | |||
} |
@@ -50,7 +50,7 @@ class TicketStore extends AbstractStore implements TicketStoreInterface | |||
$query | |||
->filterByStatus(Ticket::TICKET_STATUS_OPEN) | |||
->limit($limit) | |||
->orderBy('r.id', 'DESC'); | |||
->orderBy('.id', 'DESC'); | |||
return $query->find(); | |||
} |
@@ -9,7 +9,7 @@ class GroupUserRepositoryQuery extends AbstractRepositoryQuery implements GroupU | |||
{ | |||
public function __construct(GroupUserRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'groupUser', $paginator); | |||
} | |||
protected $isJoinUsers = false; | |||
@@ -20,7 +20,7 @@ class GroupUserRepositoryQuery extends AbstractRepositoryQuery implements GroupU | |||
if (!$this->isJoinUsers) { | |||
$this->isJoinUsers = true; | |||
return $this | |||
->innerJoin('.users', 'user'); | |||
->innerJoin('.users', 'users'); | |||
} | |||
return $this; | |||
} |
@@ -11,7 +11,7 @@ class UserRepositoryQuery extends AbstractRepositoryQuery implements UserReposit | |||
{ | |||
public function __construct(UserRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
parent::__construct($repository, 'user', $paginator); | |||
} | |||
protected $isJoinGroupUsers = false; | |||
@@ -21,9 +21,9 @@ class UserRepositoryQuery extends AbstractRepositoryQuery implements UserReposit | |||
if (!$this->isJoinGroupUsers) { | |||
$this->isJoinGroupUsers = true; | |||
$this->innerJoin('.groupUsers', 'groupUser'); | |||
$this->innerJoin('.groupUsers', 'groupUsers'); | |||
if($addSelect){ | |||
$this->addSelect('groupUser'); | |||
$this->addSelect('groupUsers'); | |||
} | |||
} | |||
return $this; |