Example #1
0
 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);
 }
Example #2
0
 protected function factoryCollectionFromFilePath($filePath)
 {
     $data = $this->parserFromFile($filePath);
     $collection = new Collection($this->parserProcess($data));
     $collection->setMeta($this->parserMetas($data));
     return $collection;
 }