예제 #1
0
 function toXML(&$writer)
 {
     $writer->xmlStartTag('Relation', array('Kind' => $this->getKind() ? $this->getKind() : 'IsPartOf'));
     $writer->xmlStartTag('Resource');
     // Identifier_
     $ides = $this->getIdentifier_Ids();
     foreach ($ides as $id) {
         $ide =& $this->getIdentifier_($id);
         $ide->toXML($writer);
     }
     if (!count($ides)) {
         include_once 'Services/MetaData/classes/class.ilMDIdentifier_.php';
         $ide = new ilMDIdentifier_($this->getRBACId(), $this->getObjId());
         $ide->toXML($writer);
     }
     // Description
     $dess = $this->getDescriptionIds();
     foreach ($dess as $id) {
         $des =& $this->getDescription($id);
         $des->toXML($writer);
     }
     if (!count($dess)) {
         include_once 'Services/MetaData/classes/class.ilMDDescription.php';
         $des = new ilMDDescription($this->getRBACId(), $this->getObjId());
         $des->toXML($writer);
     }
     $writer->xmlEndTag('Resource');
     $writer->xmlEndTag('Relation');
 }
예제 #2
0
 /**
  * test Identifier_
  * @group IL_Init 
  * @return
  */
 public function testIdentifier_()
 {
     include_once './Services/MetaData/classes/class.ilMDIdentifier_.php';
     include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
     $con = new ilMDIdentifier_(1, 2, 'xxx');
     $con->setCatalog('Easy');
     $ret = $con->save();
     $this->assertGreaterThan(0, $ret);
     $con->setCatalog('Medium');
     $con->update();
     $con->read();
     $desc = $con->getCatalog();
     $this->assertEquals('Medium', $desc);
     $con->delete();
 }
예제 #3
0
 function &getIdentifier_Ids()
 {
     include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDIdentifier_.php';
     return ilMDIdentifier_::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_relation');
 }