You are here

protected function Deleted::_setBy in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom/Deleted.php \Zend\Feed\Writer\Renderer\Entry\Atom\Deleted::_setBy()

Set entry authors

Parameters

DOMDocument $dom:

DOMElement $root:

Return value

void

1 call to Deleted::_setBy()
Deleted::render in vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom/Deleted.php
Render atom entry

File

vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom/Deleted.php, line 77

Class

Deleted

Namespace

Zend\Feed\Writer\Renderer\Entry\Atom

Code

protected function _setBy(DOMDocument $dom, DOMElement $root) {
  $data = $this->container
    ->getBy();
  if (!$data || empty($data)) {
    return;
  }
  $author = $this->dom
    ->createElement('at:by');
  $name = $this->dom
    ->createElement('name');
  $author
    ->appendChild($name);
  $root
    ->appendChild($author);
  $text = $dom
    ->createTextNode($data['name']);
  $name
    ->appendChild($text);
  if (array_key_exists('email', $data)) {
    $email = $this->dom
      ->createElement('email');
    $author
      ->appendChild($email);
    $text = $dom
      ->createTextNode($data['email']);
    $email
      ->appendChild($text);
  }
  if (array_key_exists('uri', $data)) {
    $uri = $this->dom
      ->createElement('uri');
    $author
      ->appendChild($uri);
    $text = $dom
      ->createTextNode($data['uri']);
    $uri
      ->appendChild($text);
  }
}