ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDEntity Class Reference
+ Inheritance diagram for ilMDEntity:
+ Collaboration diagram for ilMDEntity:

Public Member Functions

 ilMDEntity ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setEntity ($a_entity)
 getEntity ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 ilMDEntity ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setEntity ($a_entity)
 getEntity ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
- Public Member Functions inherited from ilMDBase
 ilMDBase ($a_rbac_id=0, $a_obj_id=0, $a_type=0)
 setRBACId ($a_id)
 getRBACId ()
 setObjId ($a_id)
 getObjId ()
 setObjType ($a_type)
 getObjType ()
 setMetaId ($a_meta_id, $a_read_data=true)
 getMetaId ()
 setParentType ($a_parent_type)
 getParentType ()
 setParentId ($a_id)
 getParentId ()
 setExportMode ($a_export_mode=true)
 getExportMode ()
 validate ()
 ilMDBase ($a_rbac_id=0, $a_obj_id=0, $a_type=0)
 setRBACId ($a_id)
 getRBACId ()
 setObjId ($a_id)
 getObjId ()
 setObjType ($a_type)
 getObjType ()
 setMetaId ($a_meta_id, $a_read_data=true)
 getMetaId ()
 setParentType ($a_parent_type)
 getParentType ()
 setParentId ($a_id)
 getParentId ()
 validate ()

Additional Inherited Members

- Data Fields inherited from ilMDBase
 $rbac_id
 $obj_id
 $obj_type
 $export_mode = false

Detailed Description

Definition at line 34 of file class.ilMDEntity.php.

Member Function Documentation

ilMDEntity::__getFields ( )

Definition at line 100 of file class.ilMDEntity.php.

References getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

{
return array('rbac_id' => $this->getRBACId(),
'obj_id' => $this->getObjId(),
'obj_type' => ilUtil::prepareDBString($this->getObjType()),
'parent_type' => $this->getParentType(),
'parent_id' => $this->getParentId(),
'entity' => ilUtil::prepareDBString($this->getEntity()));
}

+ Here is the call graph for this function:

ilMDEntity::__getFields ( )

Definition at line 102 of file class.ilMDEntity.php.

References getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), and ilMDBase\getRBACId().

Referenced by save().

{
return array('rbac_id' => array('integer',$this->getRBACId()),
'obj_id' => array('integer',$this->getObjId()),
'obj_type' => array('text',$this->getObjType()),
'parent_type' => array('text',$this->getParentType()),
'parent_id' => array('integer',$this->getParentId()),
'entity' => array('text',$this->getEntity()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDEntity::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

Definition at line 145 of file class.ilMDEntity.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT meta_entity_id FROM il_meta_entity ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
"AND obj_id = ".$ilDB->quote($a_obj_id)." ".
"AND parent_id = ".$ilDB->quote($a_parent_id)." ".
"AND parent_type = ".$ilDB->quote($a_parent_type);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ids[] = $row->meta_entity_id;
}
return $ids ? $ids : array();
}
ilMDEntity::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

Definition at line 147 of file class.ilMDEntity.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT meta_entity_id FROM il_meta_entity ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ".
"AND parent_id = ".$ilDB->quote($a_parent_id ,'integer')." ".
"AND parent_type = ".$ilDB->quote($a_parent_type ,'text')." ".
"ORDER BY meta_entity_id ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ids[] = $row->meta_entity_id;
}
return $ids ? $ids : array();
}
ilMDEntity::delete ( )

Reimplemented from ilMDBase.

Definition at line 83 of file class.ilMDEntity.php.

References $query, and ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
$query = "DELETE FROM il_meta_entity ".
"WHERE meta_entity_id = ".$ilDB->quote($this->getMetaId());
$this->db->query($query);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDEntity::delete ( )

Reimplemented from ilMDBase.

Definition at line 84 of file class.ilMDEntity.php.

References $query, $res, and ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
$query = "DELETE FROM il_meta_entity ".
"WHERE meta_entity_id = ".$ilDB->quote($this->getMetaId(),'integer');
$res = $ilDB->manipulate($query);
$this->db->query($query);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDEntity::getEntity ( )

Definition at line 48 of file class.ilMDEntity.php.

{
return $this->entity;
}
ilMDEntity::getEntity ( )

Definition at line 48 of file class.ilMDEntity.php.

Referenced by __getFields(), and toXML().

{
return $this->entity;
}

+ Here is the caller graph for this function:

ilMDEntity::ilMDEntity (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

Definition at line 36 of file class.ilMDEntity.php.

References ilMDBase\ilMDBase().

{
parent::ilMDBase($a_rbac_id,
$a_obj_id,
$a_obj_type);
}

+ Here is the call graph for this function:

ilMDEntity::ilMDEntity (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

Definition at line 36 of file class.ilMDEntity.php.

References ilMDBase\ilMDBase().

{
parent::ilMDBase($a_rbac_id,
$a_obj_id,
$a_obj_type);
}

+ Here is the call graph for this function:

ilMDEntity::read ( )

Definition at line 110 of file class.ilMDEntity.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setEntity(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

{
global $ilDB;
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_entity ".
"WHERE meta_entity_id = ".$ilDB->quote($this->getMetaId());
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setRBACId($row->rbac_id);
$this->setObjId($row->obj_id);
$this->setObjType($row->obj_type);
$this->setParentId($row->parent_id);
$this->setParentType($row->parent_type);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDEntity::read ( )

Definition at line 112 of file class.ilMDEntity.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setEntity(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), and ilMDBase\setRBACId().

{
global $ilDB;
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_entity ".
"WHERE meta_entity_id = ".$ilDB->quote($this->getMetaId() ,'integer');
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setRBACId($row->rbac_id);
$this->setObjId($row->obj_id);
$this->setObjType($row->obj_type);
$this->setParentId($row->parent_id);
$this->setParentType($row->parent_type);
$this->setEntity($row->entity);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDEntity::save ( )

Reimplemented from ilMDBase.

Definition at line 53 of file class.ilMDEntity.php.

References __getFields(), ilMDBase\getMetaId(), and ilMDBase\setMetaId().

{
global $ilDB;
$fields = $this->__getFields();
$fields['meta_entity_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_entity'));
if($this->db->insert('il_meta_entity',$fields))
{
$this->setMetaId($next_id);
return $this->getMetaId();
}
return false;
}

+ Here is the call graph for this function:

ilMDEntity::save ( )

Reimplemented from ilMDBase.

Definition at line 53 of file class.ilMDEntity.php.

References ilMDBase\getMetaId(), and ilMDBase\setMetaId().

{
if($this->db->autoExecute('il_meta_entity',
$this->__getFields(),
DB_AUTOQUERY_INSERT))
{
$this->setMetaId($this->db->getLastInsertId());
return $this->getMetaId();
}
return false;
}

+ Here is the call graph for this function:

ilMDEntity::setEntity (   $a_entity)

Definition at line 44 of file class.ilMDEntity.php.

Referenced by read().

{
$this->entity = $a_entity;
}

+ Here is the caller graph for this function:

ilMDEntity::setEntity (   $a_entity)

Definition at line 44 of file class.ilMDEntity.php.

{
$this->entity = $a_entity;
}
ilMDEntity::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 138 of file class.ilMDEntity.php.

References getEntity().

{
$writer->xmlElement('Entity',null,$this->getEntity());
}

+ Here is the call graph for this function:

ilMDEntity::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 140 of file class.ilMDEntity.php.

References getEntity().

{
$writer->xmlElement('Entity',null,$this->getEntity());
}

+ Here is the call graph for this function:

ilMDEntity::update ( )

Reimplemented from ilMDBase.

Definition at line 66 of file class.ilMDEntity.php.

References ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
if($this->db->autoExecute('il_meta_entity',
$this->__getFields(),
DB_AUTOQUERY_UPDATE,
"meta_entity_id = ".$ilDB->quote($this->getMetaId())))
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

ilMDEntity::update ( )

Reimplemented from ilMDBase.

Definition at line 68 of file class.ilMDEntity.php.

References ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
if($this->db->update('il_meta_entity',
$this->__getFields(),
array("meta_entity_id" => array('integer',$this->getMetaId()))))
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: