예제 #1
0
파일: Document.php 프로젝트: gpupo/pipe2
 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);
 }
예제 #2
0
파일: Combiner.php 프로젝트: gpupo/pipe2
 protected function factoryCollectionFromFilePath($filePath)
 {
     $data = $this->parserFromFile($filePath);
     $collection = new Collection($this->parserProcess($data));
     $collection->setMeta($this->parserMetas($data));
     return $collection;
 }