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.

32 satır
593B

  1. <?php
  2. namespace common\logic;
  3. use yii\db\ActiveQuery;
  4. class AbstractRepositoryQuery extends AbstractService implements RepositoryQueryInterface
  5. {
  6. protected ActiveQuery $query;
  7. public function __call(string $name, $params): self
  8. {
  9. call_user_func_array([$this->query, $name], $params);
  10. return $this;
  11. }
  12. public function find()
  13. {
  14. return $this->query->all();
  15. }
  16. public function findOne()
  17. {
  18. return $this->query->one();
  19. }
  20. public function filterById(int $id)
  21. {
  22. $this->query->andWhere(['id' => $id]);
  23. }
  24. }