You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserProducerRepositoryQuery.php 949B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace common\logic\User\UserProducer\Repository;
  3. use common\logic\AbstractRepositoryQuery;
  4. use common\logic\User\User\Model\User;
  5. use common\logic\User\UserProducer\Model\UserProducer;
  6. use common\logic\User\UserProducer\Service\UserProducerDefinition;
  7. use yii\db\ActiveQuery;
  8. class UserProducerRepositoryQuery extends AbstractRepositoryQuery
  9. {
  10. protected UserProducerDefinition $definition;
  11. public function loadDependencies(): void
  12. {
  13. $this->loadDefinition(UserProducerDefinition::class);
  14. }
  15. public function filterByUser(User $user): self
  16. {
  17. $this->andWhere(['id_user' => $user->id]);
  18. return $this;
  19. }
  20. public function filterByActive(bool $active): self
  21. {
  22. $this->andWhere(['active' => $active]);
  23. return $this;
  24. }
  25. public function filterByBookmark(bool $bookmark): self
  26. {
  27. $this->andWhere(['bookmark' => $bookmark]);
  28. return $this;
  29. }
  30. }