|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
-
- namespace Lc\CaracoleBundle\Repository\Address;
-
- use Lc\CaracoleBundle\Repository\AbstractStore;
- use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
- use Lc\SovBundle\Model\User\UserInterface;
- use Lc\SovBundle\Repository\RepositoryQueryInterface;
-
- class AddressStore extends AbstractStore
- {
- use MerchantStoreTrait;
-
- protected AddressRepositoryQuery $query;
-
- public function __construct(AddressRepositoryQuery $query)
- {
- $this->query = $query;
- }
- public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- $query->orderBy('id');
- return $query;
- }
-
- public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- $query->filterIsOnlineAndOffline();
- return $query;
- }
-
- public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
- {
- return $query;
- }
-
- public function getByUser(UserInterface $user)
- {
- $query = $this->createDefaultQuery();
- $query->filterByUser($user);
- return $query->find();
- }
-
- }
|