Beispiel #1
0
 /**
  * 
  * @param string $xml
  * @return array
  */
 public static function buildArrayFromXml($xml)
 {
     return Braintree_Xml_Parser::arrayFromXml($xml);
 }
Beispiel #2
-1
 /**
  * sets up the SimpleXMLIterator and starts the parsing
  * @access public
  * @param string $xml
  * @return array array mapped to the passed xml
  */
 public static function arrayFromXml($xml)
 {
     // SimpleXML provides the root information on construct
     $iterator = new SimpleXMLIterator($xml);
     $xmlRoot = Braintree_Util::delimiterToCamelCase($iterator->getName());
     $type = $iterator->attributes()->type;
     self::$_xmlRoot = $iterator->getName();
     self::$_responseType = $type;
     // return the mapped array with the root element as the header
     return array($xmlRoot => self::_iteratorToArray($iterator));
 }