protected function addChannelFields(\DOMElement $channel)
    {
        foreach ($this->feed->getChannelFields() as $field) {
            if ($field instanceof GroupChannelField) {
                $parent = $this->dom->createElement($field->getName());

                foreach ($field->getItemFields() as $childField) {
                    $child = $this->dom->createElement($childField->getName(), $childField->getValue());

                    $this->addAttributes($child, $childField);

                    $parent->appendChild($child);
                }
            } else {
                $parent = $this->dom->createElement($field->getName(), $field->getValue());
            }

            $this->addAttributes($parent, $field);

            $channel->appendChild($parent);
        }
    }
protected function addChannelFields(\DOMElement $channel)
    {
        foreach ($this->feed->getChannelFields() as $field) {
            if ($field instanceof GroupChannelField) {
                $parent = $this->dom->createElement($field->getName());

                foreach ($field->getItemFields() as $childField) {
                    $child = $this->dom->createElement($childField->getName(), $childField->getValue());

                    $this->addAttributes($child, $childField);

                    $parent->appendChild($child);
                }
            } else {
                $parent = $this->dom->createElement($field->getName(), $field->getValue());
            }

            $this->addAttributes($parent, $field);

            $channel->appendChild($parent);
        }
    }
protected function addChannelFields ( \ DOMElement $ channel ) { foreach ( $ this -> feed -> getChannelFields ( ) as $ field ) { if ( $ field instanceof GroupChannelField ) { $ parent = $ this -> dom -> createElement ( $ field -> getName ( ) ) ; foreach ( $ field -> getItemFields ( ) as $ childField ) { $ child = $ this -> dom -> createElement ( $ childField -> getName ( ) , $ childField -> getValue ( ) ) ; $ this -> addAttributes ( $ child , $ childField ) ; $ parent -> appendChild ( $ child ) ; } } else { $ parent = $ this -> dom -> createElement ( $ field -> getName ( ) , $ field -> getValue ( ) ) ; } $ this -> addAttributes ( $ parent , $ field ) ; $ channel -> appendChild ( $ parent ) ; } }
Adds channel fields to given channel.

@param \DOMElement $channel
Adds channel fields to given channel .