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; } }