Example #1
0
 public function __construct(Sabel_Xml_Element $element)
 {
     $this->documentElement = $element;
     $namespace = $element->at("xmlns");
     $this->channel = $element->getChild("channel", $namespace);
     $this->itemsElement = $element->getChildren("item", $namespace);
 }
Example #2
0
 /**
  * @return Sabel_ValueObject
  */
 protected function toObject(Sabel_Xml_Element $element)
 {
     $object = new Sabel_ValueObject();
     if ($title = $element->getChild("title")) {
         $object->title = $title->getNodeValue();
     }
     $links = $element->getChildren("link");
     foreach ($links as $link) {
         if ($link->getAttribute("rel") === "alternate") {
             $object->uri = $link->getAttribute("href");
             break;
         }
     }
     if ($summary = $element->getChild("summary")) {
         $object->description = $summary->getNodeValue();
     }
     if ($date = $element->getChild("modified")) {
         $object->date = date("Y-m-d H:i:s", strtotime($date->getNodeValue()));
     }
     if ($content = $element->getChild("content")) {
         $object->content = $content->getNodeValue();
     }
     return $object;
 }
Example #3
0
 public function __construct(Sabel_Xml_Element $element)
 {
     $this->documentElement = $element;
     $this->channel = $element->getChild("channel");
     $this->itemsElement = $this->channel->getChildren("item");
 }
Example #4
0
 public function __construct(Sabel_Xml_Element $element)
 {
     $this->documentElement = $element;
     $this->items = $element->getChildren("entry");
 }
Example #5
0
 public function __construct(Sabel_Xml_Element $element)
 {
     $this->documentElement = $element;
     $this->channel = $element->getChild("channel", $element->getAttribute("xmlns"));
     $this->items = $element->getChildren("item", $element->getAttribute("xmlns"));
 }