/**
  * Constructor
  *
  * @param   array params
  */
 public function __construct($params)
 {
     $this->item = new XPSoapNode('hash', NULL, array('xmlns:hash' => 'http://xml.apache.org/xml-soap', 'xsi:type' => 'hash:Map'));
     foreach ($params as $key => $value) {
         $this->item->addChild(XPSoapNode::fromArray(array('key' => $key, 'value' => $value), 'item'));
     }
 }
예제 #2
0
 protected function node($object)
 {
     $node = XPSoapNode::fromArray(array($object), 'array', new XPSoapMapping());
     return $node->nodeAt(0);
 }
 /**
  * Set data
  *
  * @param   array arr
  */
 public function setData($arr)
 {
     $node = XPSoapNode::fromArray($arr, 'item', $this->mapping);
     $node->namespace = $this->namespace;
     if (!$node->hasChildren()) {
         return;
     }
     // Copy all of node's children to root element
     foreach (array_keys($node->getChildren()) as $i) {
         $this->body->nodeAt(0)->addChild($node->nodeAt($i));
     }
 }