Example #1
0
 public static function from_xml($alias, $itnum, $xmlbuffer, $parent = NULL)
 {
     $xml = new SimpleXMLElement($xmlbuffer);
     $doc = ItemFactory::node($xml, '//xml');
     $item = new Item($alias, $itnum, $parent);
     $item->title = (string) $doc->title;
     $item->file = (string) $doc->find;
     $item->description = (string) $doc->descri;
     $item->subject = (string) $doc->subjec;
     $item->creator = (string) $doc->creato;
     $item->type = (string) $doc->type;
     $item->date = (string) $doc->date;
     $item->format = (string) $doc->format;
     $item->set_xml($xmlbuffer);
     return $item;
 }