function &getTaxonPathIds() { include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxonPath.php'; return ilMDTaxonPath::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_classification'); }
/** * test MetaData * @group IL_Init * @return */ public function testTaxonPath() { include_once './Services/MetaData/classes/class.ilMDTaxonPath.php'; include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php'; $con = new ilMDTaxonPath(1, 2, 'xxx'); $con->setSource('Amaya'); $ret = $con->save(); $this->assertGreaterThan(0, $ret); $con->setSource('Opera'); $con->update(); $con->read(); $desc = $con->getSource(); $this->assertEquals('Opera', $desc); $con->delete(); }
function toXML(&$writer) { $writer->xmlStartTag('Classification', array('Purpose' => $this->getPurpose() ? $this->getPurpose() : 'Idea')); // Taxon Path $taxs = $this->getTaxonPathIds(); foreach ($taxs as $id) { $tax =& $this->getTaxonPath($id); $tax->toXML($writer); } if (!count($taxs)) { include_once 'Services/MetaData/classes/class.ilMDTaxonPath.php'; $tax = new ilMDTaxonPath($this->getRBACId(), $this->getObjId()); $tax->toXML($writer); } // Description $writer->xmlElement('Description', array('Language' => $this->getDescriptionLanguageCode() ? $this->getDescriptionLanguageCode() : 'en'), $this->getDescription()); // Keyword $keys = $this->getKeywordIds(); foreach ($keys as $id) { $key =& $this->getKeyword($id); $key->toXML($writer); } if (!count($keys)) { include_once 'Services/MetaData/classes/class.ilMDKeyword.php'; $key = new ilMDKeyword($this->getRBACId(), $this->getObjId()); $key->toXML($writer); } $writer->xmlEndTag('Classification'); }