public function __construct(Collection $meta) { parent::__construct(); $this->docset = $this->createElement('channel'); $rss = $this->createElement('rss'); if ($meta->containsKey('rss')) { foreach ($meta->get('rss') as $attr => $value) { $rss->setAttribute($attr, $value); } } foreach ($meta as $key => $value) { if (empty($value)) { continue; } if (is_array($value)) { } else { $new = $this->createElement($key, $value); } if (isset($new)) { $this->docset->appendChild($new); unset($new); } } $rss->appendChild($this->docset); $this->appendChild($rss); }
protected function factoryCollectionFromFilePath($filePath) { $data = $this->parserFromFile($filePath); $collection = new Collection($this->parserProcess($data)); $collection->setMeta($this->parserMetas($data)); return $collection; }