title = $title; } /** * Sets the user that asks for the validation * * @param string $user */ public function setUser($user) { $this->user = $user; } /** * {@inheritdoc} */ public function getSubject() { if (!$this->user) { throw new LogicException('You must set an user before calling getSubject'); } if (!$this->title) { throw new LogicException('You must set a title before calling getSubject'); } return sprintf(_("Validation request from %s : '%s'"), $this->user->get_display_name(), $this->title); } /** * {@inheritdoc} */ public function getMessage() { return $this->message; } /** * {@inheritdoc} */ public function getButtonText() { return _('Validate'); } /** * {@inheritdoc} */ public function getButtonURL() { return $this->url; } }