MagpieFromSimplePie::normalize_author_inheritance PHP Method

normalize_author_inheritance() public method

MagpieFromSimplePie::normalize_author_inheritance
public normalize_author_inheritance ( &$item, SimplePie_Item $original )
$original SimplePie_Item
    function normalize_author_inheritance(&$item, $original)
    {
        // "If an atom:entry element does not contain
        // atom:author elements, then the atom:author elements
        // of the contained atom:source element are considered
        // to apply. In an Atom Feed Document, the atom:author
        // elements of the containing atom:feed element are
        // considered to apply to the entry if there are no
        // atom:author elements in the locations described
        // above." <http://atompub.org/2005/08/17/draft-ietf-atompub-format-11.html#rfc.section.4.2.1>
        if (!isset($item["author#"])) {
            $authors = $original->get_authors();
            foreach ($authors as $author) {
                $tag = $this->increment_element($item, 'author', 'atom', array());
                $item[$tag] = $item["{$tag}_name"] = $author->get_name();
                if ($author->get_link()) {
                    $item["{$tag}_uri"] = $item["{$tag}_url"] = $author->get_link();
                }
                if ($author->get_email()) {
                    $item["{$tag}_email"] = $author->get_email();
                }
            }
        }
    }