예제 #1
0
 /**
  * Creates and return eZPageBlockItem object from given XML
  *
  * @static
  * @param DOMElement $node
  * @return eZPageBlockItem
  */
 public static function createFromXML(DOMElement $node)
 {
     $newObj = new eZPageBlockItem();
     if ($node->hasAttributes()) {
         foreach ($node->attributes as $attr) {
             $newObj->setAttribute($attr->name, $attr->value);
         }
     }
     foreach ($node->childNodes as $node) {
         if ($node->nodeType == XML_ELEMENT_NODE) {
             $newObj->setAttribute($node->nodeName, $node->nodeValue);
         }
     }
     return $newObj;
 }