Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- <?php
-
- namespace domain\User\UserProducer;
-
- use domain\User\User\User;
- use domain\_\AbstractRepositoryQuery;
-
- 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;
- }
-
- public function filterHasNegativeOrPositiveCredit(): self
- {
- $this->andWhere('user_producer.credit IS NOT NULL AND user_producer.credit != 0');
-
- return $this;
- }
- }
|