|
123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
-
- namespace Lc\PietroBundle\Repository\Workshop;
-
- use Lc\PietroBundle\Model\Workshop\WorkshopThematicInterface;
- use Lc\SovBundle\Repository\AbstractStore;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- class WorkshopStore extends AbstractStore
- {
- protected WorkshopRepositoryQuery $query;
-
- public function __construct(WorkshopRepositoryQuery $query)
- {
- $this->query = $query;
- }
-
- public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- $query->orderBy('position');
- return $query;
- }
-
- public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- return $query;
- }
-
- public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- return $query;
- }
-
- public function findOnlineByWorkshopThematic(WorkshopThematicInterface $workshopThematic, $query = null)
- {
- $query = $this->createDefaultQuery($query);
- $query
- ->filterByWorkshopThematic($workshopThematic)
- ->filterIsOnline();
- return $query->find();
- }
- }
|