|
12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
-
- namespace common\logic\User\UserProducer\Repository;
-
- use common\logic\AbstractRepositoryQuery;
- use common\logic\User\User\Model\User;
- use common\logic\User\UserProducer\Model\UserProducer;
- use common\logic\User\UserProducer\Service\UserProducerDefinition;
- use yii\db\ActiveQuery;
-
- class UserProducerRepositoryQuery extends AbstractRepositoryQuery
- {
- protected UserProducerDefinition $definition;
-
- public function loadDependencies(): void
- {
- $this->loadDefinition(UserProducerDefinition::class);
- }
-
- public function filterByUser(User $user): self
- {
- $this->andWhere(['id_user' => $user->id]);
- return $this;
- }
-
- public function filterByActive(bool $active): self
- {
- $this->andWhere(['active' => $active]);
- return $this;
- }
-
- public function filterByBookmark(bool $bookmark): self
- {
- $this->andWhere(['bookmark' => $bookmark]);
- return $this;
- }
- }
|