Beispiel #1
0
 public static function load($xml, $version_id = null, $test_id = null)
 {
     if ($xml instanceof DOMElement) {
         $dom = $xml;
     } else {
         $dom = new DOMDocument();
         $dom->loadXML($xml);
     }
     $lst = $dom->getElementsByTagName('result');
     $col = array();
     foreach ($lst as $item) {
         $obj = new Litmus_Result();
         foreach ($item->childNodes as $child) {
             $property = $child->nodeName;
             $obj->{$property} = $child;
             $obj->setVersionId($version_id);
             $obj->setTestId($test_id);
         }
         array_push($col, $obj);
     }
     return $col;
 }