ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDAnnotation Class Reference
+ Inheritance diagram for ilMDAnnotation:
+ Collaboration diagram for ilMDAnnotation:

Public Member Functions

 ilMDAnnotation ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setEntity ($a_entity)
 getEntity ()
 setDate ($a_date)
 getDate ()
 setDescription ($a_desc)
 getDescription ()
 setDescriptionLanguage ($lng_obj)
getDescriptionLanguage ()
 getDescriptionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id)
 ilMDAnnotation ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setEntity ($a_entity)
 getEntity ()
 setDate ($a_date)
 getDate ()
 setDescription ($a_desc)
 getDescription ()
 setDescriptionLanguage ($lng_obj)
getDescriptionLanguage ()
 getDescriptionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id)
- 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 33 of file class.ilMDAnnotation.php.

Member Function Documentation

ilMDAnnotation::__getFields ( )

Definition at line 134 of file class.ilMDAnnotation.php.

References getDate(), getDescription(), getDescriptionLanguageCode(), getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

{
return array('rbac_id' => $this->getRBACId(),
'obj_id' => $this->getObjId(),
'obj_type' => $this->getObjType(),
'entity' => $this->getEntity(),
'date' => $this->getDate(),
'description' => $this->getDescription(),
'description_language' => $this->getDescriptionLanguageCode());
}

+ Here is the call graph for this function:

ilMDAnnotation::__getFields ( )

Definition at line 134 of file class.ilMDAnnotation.php.

References getDate(), getDescription(), getDescriptionLanguageCode(), getEntity(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

{
return array('rbac_id' => $this->getRBACId(),
'obj_id' => $this->getObjId(),
'obj_type' => ilUtil::prepareDBString($this->getObjType()),
'entity' => ilUtil::prepareDBString($this->getEntity()),
'date' => ilUtil::prepareDBString($this->getDate()),
'description' => ilUtil::prepareDBString($this->getDescription()),
'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
}

+ Here is the call graph for this function:

ilMDAnnotation::_getIds (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 188 of file class.ilMDAnnotation.php.

References $res, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT meta_annotation_id FROM il_meta_annotation ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
"AND obj_id = ".$ilDB->quote($a_obj_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ids[] = $row->meta_annotation_id;
}
return $ids ? $ids : array();
}
ilMDAnnotation::_getIds (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 191 of file class.ilMDAnnotation.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilMD\getAnnotationIds().

{
global $ilDB;
$query = "SELECT meta_annotation_id FROM il_meta_annotation ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
"AND obj_id = ".$ilDB->quote($a_obj_id);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ids[] = $row->meta_annotation_id;
}
return $ids ? $ids : array();
}

+ Here is the caller graph for this function:

ilMDAnnotation::delete ( )

Reimplemented from ilMDBase.

Definition at line 117 of file class.ilMDAnnotation.php.

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDAnnotation::delete ( )

Reimplemented from ilMDBase.

Definition at line 117 of file class.ilMDAnnotation.php.

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDAnnotation::getDate ( )

Definition at line 55 of file class.ilMDAnnotation.php.

{
return $this->date;
}
ilMDAnnotation::getDate ( )

Definition at line 55 of file class.ilMDAnnotation.php.

Referenced by __getFields(), and toXML().

{
return $this->date;
}

+ Here is the caller graph for this function:

ilMDAnnotation::getDescription ( )

Definition at line 63 of file class.ilMDAnnotation.php.

Referenced by __getFields(), and toXML().

{
return $this->description;
}

+ Here is the caller graph for this function:

ilMDAnnotation::getDescription ( )

Definition at line 63 of file class.ilMDAnnotation.php.

{
return $this->description;
}
& ilMDAnnotation::getDescriptionLanguage ( )

Definition at line 74 of file class.ilMDAnnotation.php.

{
return $this->description_language;
}
& ilMDAnnotation::getDescriptionLanguage ( )

Definition at line 74 of file class.ilMDAnnotation.php.

{
return $this->description_language;
}
ilMDAnnotation::getDescriptionLanguageCode ( )

Definition at line 78 of file class.ilMDAnnotation.php.

Referenced by __getFields(), and toXML().

{
if(is_object($this->description_language))
{
return $this->description_language->getLanguageCode();
}
return false;
}

+ Here is the caller graph for this function:

ilMDAnnotation::getDescriptionLanguageCode ( )

Definition at line 78 of file class.ilMDAnnotation.php.

{
if(is_object($this->description_language))
{
return $this->description_language->getLanguageCode();
}
return false;
}
ilMDAnnotation::getEntity ( )

Definition at line 47 of file class.ilMDAnnotation.php.

Referenced by __getFields(), and toXML().

{
return $this->entity;
}

+ Here is the caller graph for this function:

ilMDAnnotation::getEntity ( )

Definition at line 47 of file class.ilMDAnnotation.php.

{
return $this->entity;
}
ilMDAnnotation::ilMDAnnotation (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

Definition at line 35 of file class.ilMDAnnotation.php.

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

Definition at line 35 of file class.ilMDAnnotation.php.

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDAnnotation::read ( )

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

References $res, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setDate(), setDescription(), setEntity(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

{
global $ilDB;
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_annotation ".
"WHERE meta_annotation_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->setEntity(ilUtil::stripSlashes($row->entity));
$this->setDate(ilUtil::stripSlashes($row->date));
$this->setDescription(ilUtil::stripSlashes($row->description));
$this->description_language =& new ilMDLanguageItem($row->description_language);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDAnnotation::read ( )

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

References $res, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setDate(), setDescription(), setEntity(), ilMDBase\setObjId(), ilMDBase\setObjType(), and ilMDBase\setRBACId().

{
global $ilDB;
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_annotation ".
"WHERE meta_annotation_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->setEntity($row->entity);
$this->setDate($row->date);
$this->setDescription($row->description);
$this->description_language =& new ilMDLanguageItem($row->description_language);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDAnnotation::save ( )

Reimplemented from ilMDBase.

Definition at line 87 of file class.ilMDAnnotation.php.

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

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

+ Here is the call graph for this function:

ilMDAnnotation::save ( )

Reimplemented from ilMDBase.

Definition at line 87 of file class.ilMDAnnotation.php.

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

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

+ Here is the call graph for this function:

ilMDAnnotation::setDate (   $a_date)

Definition at line 51 of file class.ilMDAnnotation.php.

Referenced by read().

{
$this->date = $a_date;
}

+ Here is the caller graph for this function:

ilMDAnnotation::setDate (   $a_date)

Definition at line 51 of file class.ilMDAnnotation.php.

{
$this->date = $a_date;
}
ilMDAnnotation::setDescription (   $a_desc)

Definition at line 59 of file class.ilMDAnnotation.php.

{
$this->description = $a_desc;
}
ilMDAnnotation::setDescription (   $a_desc)

Definition at line 59 of file class.ilMDAnnotation.php.

Referenced by read().

{
$this->description = $a_desc;
}

+ Here is the caller graph for this function:

ilMDAnnotation::setDescriptionLanguage (   $lng_obj)

Definition at line 67 of file class.ilMDAnnotation.php.

{
if(is_object($lng_obj))
{
$this->description_language =& $lng_obj;
}
}
ilMDAnnotation::setDescriptionLanguage (   $lng_obj)

Definition at line 67 of file class.ilMDAnnotation.php.

{
if(is_object($lng_obj))
{
$this->description_language =& $lng_obj;
}
}
ilMDAnnotation::setEntity (   $a_entity)

Definition at line 43 of file class.ilMDAnnotation.php.

Referenced by read().

{
$this->entity = $a_entity;
}

+ Here is the caller graph for this function:

ilMDAnnotation::setEntity (   $a_entity)

Definition at line 43 of file class.ilMDAnnotation.php.

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

Reimplemented from ilMDBase.

Definition at line 176 of file class.ilMDAnnotation.php.

References getDate(), getDescription(), getDescriptionLanguageCode(), and getEntity().

{
$writer->xmlStartTag('Annotation');
$writer->xmlElement('Entity',null,$this->getEntity());
$writer->xmlElement('Date',null,$this->getDate());
$writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
$writer->xmlEndTag('Annotation');
}

+ Here is the call graph for this function:

ilMDAnnotation::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 176 of file class.ilMDAnnotation.php.

References getDate(), getDescription(), getDescriptionLanguageCode(), and getEntity().

{
$writer->xmlStartTag('Annotation');
$writer->xmlElement('Entity',null,$this->getEntity());
$writer->xmlElement('Date',null,$this->getDate());
$writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()
: 'en'),
$this->getDescription());
$writer->xmlEndTag('Annotation');
}

+ Here is the call graph for this function:

ilMDAnnotation::update ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDAnnotation::update ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
if($this->db->autoExecute('il_meta_annotation',
$this->__getFields(),
DB_AUTOQUERY_UPDATE,
"meta_annotation_id = ".$ilDB->quote($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: