charset = $charset; return $this; } /** {@inheritdoc} */ public function getCharset() { $charset = $this->charset; if (is_null($charset)) { return static::DEFAULT_CHARSET; } return $charset; } /** * Set the last modified time * * @param int $lastModified The last modified time * @return void */ public function setLastModified($lastModified) { $this->lastModified = $lastModified; } /** * {@inheritdoc} * * @param array $items {@inheritdoc} */ public function setItems(array $items) { $this->items = $items; return $this; } /** {@inheritdoc} */ public function getItems() { if (!is_array($this->items)) { throw new \LogicException(sprintf('Feed the %s with "setItems" method before !', get_class($this))); } return $this->items; } /** * {@inheritdoc} * * @param array $extraInfos {@inheritdoc} */ public function setExtraInfos(array $extraInfos = []) { foreach (['name', 'uri', 'icon', 'donationUri'] as $infoName) { if (!isset($extraInfos[$infoName])) { $extraInfos[$infoName] = ''; } } $this->extraInfos = $extraInfos; return $this; } /** {@inheritdoc} */ public function getExtraInfos() { if (is_null($this->extraInfos)) { // No extra info ? $this->setExtraInfos(); // Define with default value } return $this->extraInfos; } }