|
- <?php
-
- namespace Lc\PietroBundle\Repository\Workshop;
-
- use Lc\PietroBundle\Model\Workshop\WorkshopInterface;
- use Lc\SovBundle\Repository\AbstractStore;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- class EntryStore extends AbstractStore
- {
- protected EntryRepositoryQuery $query;
-
- public function __construct(EntryRepositoryQuery $query)
- {
- $this->query = $query;
- }
-
- public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- $query->orderBy('id');
- return $query;
- }
-
- public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- return $query;
- }
-
- public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- return $query;
- }
-
- public function getOneByEmailAndWorkshop(string $email, WorkshopInterface $workshop, $query = null)
- {
- $query = $this->createDefaultQuery($query);
- $query->filterByEmail($email);
- $query->filterByWorkshop($workshop);
- return $query->findOne();
- }
- }
|