basket = $basket; } public function setPusher(User $pusher) { $this->pusher = $pusher; } /** * {@inheritdoc} */ public function getSubject() { if (!$this->basket) { throw new LogicException('You must set a basket before calling getSubject'); } return $this->app->trans('Reception of %basket_name%', ['%basket_name%' => $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 $this->app->trans('You just received a push containing %quantity% documents from %user%', ['%quantity%' => count($this->basket->getElements()), '%user%' => $this->pusher->getDisplayName()]) . "\n" . $this->message; } /** * {@inheritdoc} */ public function getButtonText() { return $this->app->trans('Watch it online'); } /** * {@inheritdoc} */ public function getButtonURL() { return $this->url; } }