Exemplo n.º 1
0
 private function __construct($objectId, $mySide)
 {
     $this->mySide = $mySide;
     $this->object = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $objectId);
     if (!$this->object || !$this->object instanceof \steam_container) {
         throw new Exception("Wave side not found.");
     }
     //$controlObject = \steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), $this->object->get_path() . "/control.xml");
     if (isset($controlObject) && $controlObject instanceof \steam_document) {
         $xmlStr = $controlObject->get_content();
         $xml = simplexml_load_string($xmlStr);
         $children = $xml->children();
         foreach ($children as $child) {
             if ($child->getName() == "OBJ_DESC") {
                 $this->object->set_attribute(OBJ_DESC, $child->asXML());
             } else {
                 if ($child->getName() == "steamweb_type") {
                     $this->object->set_attribute("WAVEPAGE_TYPE", $child->asXML());
                 } else {
                     if ($child->getName() == "steamweb_type_config") {
                         $subChildren = $child->children();
                         $map = XmlHelper::xml_to_array($subChildren[0]);
                         $this->object->set_attribute("WAVEPAGE_TYPE_CONFIG", $map[0]);
                     } else {
                         if ($child->getName() == "steamweb_module_ssp") {
                             $subChildren = $child->children();
                             $this->object->set_attribute("WAVEPAGE_MODULE_SSP_ALBUM_NO", $subChildren[0]->asXML());
                         }
                     }
                 }
             }
         }
     }
 }