You are here

class Atom in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php \Zend\Feed\Reader\Entry\Atom
  2. 8.0 vendor/zendframework/zend-feed/src/Reader/Feed/Atom.php \Zend\Feed\Reader\Feed\Atom
  3. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php \Zend\Feed\Writer\Renderer\Entry\Atom
  4. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php \Zend\Feed\Writer\Renderer\Feed\Atom
Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php \Zend\Feed\Writer\Renderer\Feed\Atom

Hierarchy

  • class \Zend\Feed\Writer\Renderer\Feed\AbstractAtom extends \Renderer\AbstractRenderer
    • class \Zend\Feed\Writer\Renderer\Feed\Atom implements \Renderer\RendererInterface

Expanded class hierarchy of Atom

3 string references to 'Atom'
Feed::export in vendor/zendframework/zend-feed/src/Writer/Feed.php
Attempt to build and return the feed resulting from the data set
Reader::registerCoreExtensions in vendor/zendframework/zend-feed/src/Reader/Reader.php
Register core (default) extensions
Writer::registerCoreExtensions in vendor/zendframework/zend-feed/src/Writer/Writer.php
Register core (default) extensions

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php, line 18

Namespace

Zend\Feed\Writer\Renderer\Feed
View source
class Atom extends AbstractAtom implements Renderer\RendererInterface {

  /**
   * Constructor
   *
   * @param  Writer\Feed $container
   */
  public function __construct(Writer\Feed $container) {
    parent::__construct($container);
  }

  /**
   * Render Atom feed
   *
   * @return Atom
   */
  public function render() {
    if (!$this->container
      ->getEncoding()) {
      $this->container
        ->setEncoding('UTF-8');
    }
    $this->dom = new DOMDocument('1.0', $this->container
      ->getEncoding());
    $this->dom->formatOutput = true;
    $root = $this->dom
      ->createElementNS(Writer\Writer::NAMESPACE_ATOM_10, 'feed');
    $this
      ->setRootElement($root);
    $this->dom
      ->appendChild($root);
    $this
      ->_setLanguage($this->dom, $root);
    $this
      ->_setBaseUrl($this->dom, $root);
    $this
      ->_setTitle($this->dom, $root);
    $this
      ->_setDescription($this->dom, $root);
    $this
      ->_setImage($this->dom, $root);
    $this
      ->_setDateCreated($this->dom, $root);
    $this
      ->_setDateModified($this->dom, $root);
    $this
      ->_setGenerator($this->dom, $root);
    $this
      ->_setLink($this->dom, $root);
    $this
      ->_setFeedLinks($this->dom, $root);
    $this
      ->_setId($this->dom, $root);
    $this
      ->_setAuthors($this->dom, $root);
    $this
      ->_setCopyright($this->dom, $root);
    $this
      ->_setCategories($this->dom, $root);
    $this
      ->_setHubs($this->dom, $root);
    foreach ($this->extensions as $ext) {
      $ext
        ->setType($this
        ->getType());
      $ext
        ->setRootElement($this
        ->getRootElement());
      $ext
        ->setDOMDocument($this
        ->getDOMDocument(), $root);
      $ext
        ->render();
    }
    foreach ($this->container as $entry) {
      if ($this
        ->getDataContainer()
        ->getEncoding()) {
        $entry
          ->setEncoding($this
          ->getDataContainer()
          ->getEncoding());
      }
      if ($entry instanceof Writer\Entry) {
        $renderer = new Renderer\Entry\Atom($entry);
      }
      else {
        if (!$this->dom->documentElement
          ->hasAttribute('xmlns:at')) {
          $this->dom->documentElement
            ->setAttribute('xmlns:at', 'http://purl.org/atompub/tombstones/1.0');
        }
        $renderer = new Renderer\Entry\AtomDeleted($entry);
      }
      if ($this->ignoreExceptions === true) {
        $renderer
          ->ignoreExceptions();
      }
      $renderer
        ->setType($this
        ->getType());
      $renderer
        ->setRootElement($this->dom->documentElement);
      $renderer
        ->render();
      $element = $renderer
        ->getElement();
      $deep = version_compare(PHP_VERSION, '7', 'ge') ? 1 : true;
      $imported = $this->dom
        ->importNode($element, $deep);
      $root
        ->appendChild($imported);
    }
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractAtom::_setAuthors protected function Set feed authors
AbstractAtom::_setBaseUrl protected function Set base URL to feed links
AbstractAtom::_setCategories protected function Set feed categories
AbstractAtom::_setCopyright protected function Set feed copyright
AbstractAtom::_setDateCreated protected function Set date feed was created
AbstractAtom::_setDateModified protected function Set date feed was last modified
AbstractAtom::_setDescription protected function Set feed description
AbstractAtom::_setFeedLinks protected function Set feed links
AbstractAtom::_setGenerator protected function Set feed generator string 2
AbstractAtom::_setHubs protected function Set hubs to which this feed pushes
AbstractAtom::_setId protected function Set feed identifier
AbstractAtom::_setImage protected function Set feed level logo (image)
AbstractAtom::_setLanguage protected function Set feed language
AbstractAtom::_setLink protected function Set link to feed
AbstractAtom::_setTitle protected function Set feed title
Atom::render public function Render Atom feed
Atom::__construct public function Constructor Overrides AbstractAtom::__construct