basket = $basket; } public function setPusher(\User_Adapter $pusher) { $this->pusher = $pusher; } /** * {@inheritdoc} */ public function getSubject() { if (!$this->basket) { throw new LogicException('You must set a basket before calling getSubject'); } return sprintf(_('Reception of %s'), $this->basket->getName()); } /** * {@inheritdoc} */ public function getMessage() { if (!$this->pusher) { throw new LogicException('You must set a basket before calling getMessage'); } if (!$this->basket) { throw new LogicException('You must set a basket before calling getMessage'); } return sprintf(_('You just received a push containing %s documents from %s'), count($this->basket->getElements()), $this->pusher->get_display_name()) . "\n" . $this->message; } /** * {@inheritdoc} */ public function getButtonText() { return _('Watch it online'); } /** * {@inheritdoc} */ public function getButtonURL() { return $this->url; } }