Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

28 rindas
630B

  1. <?php
  2. namespace domain\User\UserMessage;
  3. use domain\_\AbstractRepositoryQuery;
  4. use domain\User\User\User;
  5. class UserMessageRepositoryQuery extends AbstractRepositoryQuery
  6. {
  7. protected UserMessageDefinition $definition;
  8. public function loadDependencies(): void
  9. {
  10. $this->loadDefinition(UserMessageDefinition::class);
  11. }
  12. public function filterByUser(User $user): self
  13. {
  14. $this->andWhere(['user_message.id_user' => $user->id]);
  15. return $this;
  16. }
  17. public function filterIsUnread(): self
  18. {
  19. $this->andWhere('user_message.read_at IS NULL');
  20. return $this;
  21. }
  22. }