function &getEntityIds()
 {
     include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDEntity.php';
     return ilMDEntity::_getIds($this->getRBACId(), $this->getObjId(), $this->getMetaId(), 'meta_contribute');
 }
Example #2
0
 /**
  * test Entity
  * @group IL_Init
  * @return
  */
 public function testEntity()
 {
     include_once './Services/MetaData/classes/class.ilMDEntity.php';
     include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
     $con = new ilMDEntity(1, 2, 'xxx');
     $con->setEntity('Easy');
     $ret = $con->save();
     $this->assertGreaterThan(0, $ret);
     $con->setEntity('Medium');
     $con->update();
     $con->read();
     $desc = $con->getEntity();
     $this->assertEquals('Medium', $desc);
     $con->delete();
 }
 function toXML(&$writer)
 {
     $writer->xmlStartTag('Contribute', array('Role' => $this->getRole() ? $this->getRole() : 'Author'));
     // Entities
     $entities = $this->getEntityIds();
     foreach ($entities as $id) {
         $ent =& $this->getEntity($id);
         $ent->toXML($writer);
     }
     if (!count($entities)) {
         include_once 'Services/MetaData/classes/class.ilMDEntity.php';
         $ent = new ilMDEntity($this->getRBACId(), $this->getObjId());
         $ent->toXML($writer);
     }
     $writer->xmlElement('Date', null, $this->getDate());
     $writer->xmlEndTag('Contribute');
 }