function toXML(&$writer)
 {
     $writer->xmlStartTag('TaxonPath');
     $writer->xmlElement('Source', array('Language' => $this->getSourceLanguageCode() ? $this->getSourceLanguageCode() : 'en'), $this->getSource());
     // Taxon
     $taxs = $this->getTaxonIds();
     foreach ($taxs as $id) {
         $tax =& $this->getTaxon($id);
         $tax->toXML($writer);
     }
     if (!count($taxs)) {
         include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
         $tax = new ilMDTaxon($this->getRBACId(), $this->getObjId());
         $tax->toXML($writer);
     }
     $writer->xmlEndTag('TaxonPath');
 }
Beispiel #2
0
 /**
  * test MetaData
  * @group IL_Init
  * @return
  */
 public function testTaxon()
 {
     include_once './Services/MetaData/classes/class.ilMDTaxon.php';
     include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
     $con = new ilMDTaxon(1, 2, 'xxx');
     $con->setTaxon('Amaya');
     $ret = $con->save();
     $this->assertGreaterThan(0, $ret);
     $con->setTaxon('Opera');
     $con->update();
     $con->read();
     $desc = $con->getTaxon();
     $this->assertEquals('Opera', $desc);
     $con->delete();
 }
 function &getTaxonIds()
 {
     include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
     return ilMDTaxon::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_taxon_path');
 }