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.

StatusRepositoryQueryTrait.php 622B

3 vuotta sitten
1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Lc\SovBundle\Repository;
  3. trait StatusRepositoryQueryTrait
  4. {
  5. public function filterByStatus(int $status):self
  6. {
  7. return $this->andWhere('.status = :status')->setParameter(':status', $status);
  8. }
  9. public function filterIsOffline():self
  10. {
  11. return $this->andWhere('.status = :status')->setParameter(':status', 0);
  12. }
  13. public function filterIsOnline():self
  14. {
  15. return $this->andWhere('.status = :status')->setParameter(':status', 1);
  16. }
  17. public function filterIsOnlineAndOffline():self
  18. {
  19. return $this->andWhere('.status >= 0');
  20. }
  21. }