author = $author; $this->subscriber = $subscriber; $this->action = $action; } /** * @ORM\PrePersist */ public function onCreate() { if (!$this->date) { $this->date = new \DateTime(); } } public function getId(): int { return $this->id; } public function getDate(): \DateTime { return $this->date; } public function getSubscriber(): User { return $this->subscriber; } public function getAuthor(): User { return $this->author; } public function getAction(): string { return $this->action; } }