title = $title; } /** * Sets the author * * @param string $author */ public function setAuthor($author) { $this->author = $author; } /** * {@inheritdoc} */ public function getSubject() { if (!$this->title) { throw new LogicException('You must set an title before calling getMessage'); } return $this->app->trans('Nouvelle publication : %title%', ['%title%' => $this->title]); } /** * {@inheritdoc} */ public function getMessage() { if (!$this->author) { throw new LogicException('You must set an author before calling getMessage'); } if (!$this->title) { throw new LogicException('You must set an title before calling getMessage'); } return $this->app->trans('%user% vient de publier %title%', ['%user%' => $this->author, '%title%' => $this->title]); } /** * {@inheritdoc} */ public function getButtonText() { return $this->app->trans('View on %title%', ['%title%' => $this->getPhraseanetTitle()]); } /** * {@inheritdoc} */ public function getButtonURL() { return $this->url; } }