コード例 #1
0
 /**
  * (non-PHPdoc)
  * @see \Rhapsody\SetupBundle\Data\IDataSource::findObject()
  */
 public function findObject($name)
 {
     $results = $this->xml->getAll("object[@name = '" . $name . "']");
     if (is_array($results)) {
         if (count($results) >= 1) {
             return $this->parseObject($results[0]);
         }
     }
     return null;
 }
コード例 #2
0
 /**
  * @param $name
  * @return unknown_type
  */
 public function testGetAllArray()
 {
     $xml = '<element><one></one><one></one><two></two></element>';
     $element = new XmlElement($xml);
     $result = $element->getAll(array('one', 'two'));
     $this->assertNotNull($result);
     $this->assertEquals(3, sizeof($result));
 }