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.
|
- <?php
-
- namespace domain\User\UserMessage;
-
- use domain\_\AbstractRepositoryQuery;
- use domain\User\User\User;
-
- class UserMessageRepositoryQuery extends AbstractRepositoryQuery
- {
- protected UserMessageDefinition $definition;
-
- public function loadDependencies(): void
- {
- $this->loadDefinition(UserMessageDefinition::class);
- }
-
- public function filterByUser(User $user): self
- {
- $this->andWhere(['user_message.id_user' => $user->id]);
- return $this;
- }
-
- public function filterIsUnread(): self
- {
- $this->andWhere('user_message.read_at IS NULL');
- return $this;
- }
- }
|