/**
  * This is internally called right after `execute`. 
  * Typically used to prepare the class state with the `xmlResult` object. 
  * @return void
  */
 protected function prepareResponse()
 {
     if (isset($this->response)) {
         return;
     }
     if (isset($this->xmlResponse) && is_subclass_of(static::$RESPONSE_CLASS, self::$RESPONSE_CLASS)) {
         $this->response = new static::$RESPONSE_CLASS();
         $this->response->loadXML($this->xmlResponse);
     }
 }
 /**
  * (non-PHPdoc)
  * @see \zamnuts\EANAPIClient\Common\SupportModels\EANAbstractSupportModel::loadXML()
  * @param SimpleXMLElement $xml
  */
 public function loadXML(SimpleXMLElement $xml)
 {
     parent::loadXML($xml);
     $LandmarkListRoot = EANLandmarkListSummaries::getRootTagName();
     if (isset($xml->{$LandmarkListRoot})) {
         $attrs = $xml->{$LandmarkListRoot}->attributes();
         if (isset($attrs->activePropertyCount)) {
             $this->activePropertyCount = (int) $attrs->activePropertyCount;
         }
     }
 }
 /**
  * @param SimpleXMLElement $xml
  */
 public function loadXML(SimpleXMLElement $xml)
 {
     parent::loadXML($xml);
     $this->items = array();
     $childTag = $this->get__childTagName();
     if (isset($childTag) && $childTag && isset($xml->{$childTag})) {
         foreach ($xml->{$childTag} as $xmlChild) {
             $item = new static::$CHILD_CLASS();
             $item->loadXML($xmlChild);
             $this->addItem($item);
         }
     }
     $this->refreshXML();
 }
Exemplo n.º 4
0
 /**
  * (non-PHPdoc)
  * @see \zamnuts\EANAPIClient\Common\SupportModels\EANAbstractSupportModel::loadXML()
  * @param SimpleXMLElement $xml
  */
 public function loadXML(SimpleXMLElement $xml)
 {
     parent::loadXML($xml);
     if (isset($xml->ErrorAttributes->errorAttributesMap) && isset($xml->ErrorAttributes->errorAttributesMap->entry)) {
         foreach ($xml->ErrorAttributes->errorAttributesMap->entry as $entry) {
             if (isset($entry->key, $entry->value, $this->errorAttributes[$entry->key])) {
                 $this->errorAttributes[$entry->key] = $entry->value;
             }
         }
     } else {
         if (isset($xml->ErrorAttributes)) {
             foreach ($xml->ErrorAttributes as $key => $value) {
                 $this->errorAttributes[$key] = $value;
             }
         }
     }
 }