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

Public Member Functions

 ilMDTaxonPath ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
getTaxonIds ()
getTaxon ($a_taxon_id)
addTaxon ()
 setSource ($a_source)
 getSource ()
 setSourceLanguage (&$lng_obj)
getSourceLanguage ()
 getSourceLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 ilMDTaxonPath ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
getTaxonIds ()
getTaxon ($a_taxon_id)
addTaxon ()
 setSource ($a_source)
 getSource ()
 setSourceLanguage (&$lng_obj)
getSourceLanguage ()
 getSourceLanguageCode ()
 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 33 of file class.ilMDTaxonPath.php.

Member Function Documentation

ilMDTaxonPath::__getFields ( )

Definition at line 152 of file class.ilMDTaxonPath.php.

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

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()),
'source' => array('text',$this->getSource()),
'source_language' => array('text',$this->getSourceLanguageCode()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDTaxonPath::__getFields ( )

Definition at line 152 of file class.ilMDTaxonPath.php.

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), getSource(), getSourceLanguageCode(), 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(),
'source' => ilUtil::prepareDBString($this->getSource()),
'source_language' => ilUtil::prepareDBString($this->getSourceLanguageCode()));
}

+ Here is the call graph for this function:

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

Definition at line 213 of file class.ilMDTaxonPath.php.

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

{
global $ilDB;
$query = "SELECT meta_taxon_path_id FROM il_meta_taxon_path ".
"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_taxon_path_id;
}
return $ids ? $ids : array();
}
ilMDTaxonPath::_getIds (   $a_rbac_id,
  $a_obj_id,
  $a_parent_id,
  $a_parent_type 
)

Definition at line 223 of file class.ilMDTaxonPath.php.

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

Referenced by getTaxonIds().

{
global $ilDB;
$query = "SELECT meta_taxon_path_id FROM il_meta_taxon_path ".
"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');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$ids[] = $row->meta_taxon_path_id;
}
return $ids ? $ids : array();
}

+ Here is the caller graph for this function:

& ilMDTaxonPath::addTaxon ( )

Definition at line 62 of file class.ilMDTaxonPath.php.

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

{
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
$tax =& new ilMDTaxon($this->getRBACId(),$this->getObjId(),$this->getObjType());
$tax->setParentId($this->getMetaId());
$tax->setParentType('meta_taxon_path');
return $tax;
}

+ Here is the call graph for this function:

& ilMDTaxonPath::addTaxon ( )

Definition at line 62 of file class.ilMDTaxonPath.php.

References ilMDBase\getMetaId(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

{
include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
$tax =& new ilMDTaxon($this->getRBACId(),$this->getObjId(),$this->getObjType());
$tax->setParentId($this->getMetaId());
$tax->setParentType('meta_taxon_path');
return $tax;
}

+ Here is the call graph for this function:

ilMDTaxonPath::delete ( )

Reimplemented from ilMDBase.

Definition at line 129 of file class.ilMDTaxonPath.php.

References $ilDB, $query, ilMDBase\getMetaId(), getTaxon(), and getTaxonIds().

{
global $ilDB;
if($this->getMetaId())
{
$query = "DELETE FROM il_meta_taxon_path ".
"WHERE meta_taxon_path_id = ".$ilDB->quote($this->getMetaId());
$this->db->query($query);
foreach($this->getTaxonIds() as $id)
{
$tax = $this->getTaxon($id);
$tax->delete();
}
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDTaxonPath::delete ( )

Reimplemented from ilMDBase.

Definition at line 130 of file class.ilMDTaxonPath.php.

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

{
global $ilDB;
if($this->getMetaId())
{
$query = "DELETE FROM il_meta_taxon_path ".
"WHERE meta_taxon_path_id = ".$ilDB->quote($this->getMetaId(), 'integer');
$res = $ilDB->manipulate($query);
foreach($this->getTaxonIds() as $id)
{
$tax = $this->getTaxon($id);
$tax->delete();
}
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDTaxonPath::getSource ( )

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

{
return $this->source;
}
ilMDTaxonPath::getSource ( )

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

Referenced by __getFields(), and toXML().

{
return $this->source;
}

+ Here is the caller graph for this function:

& ilMDTaxonPath::getSourceLanguage ( )

Definition at line 89 of file class.ilMDTaxonPath.php.

{
return is_object($this->source_language) ? $this->source_language : false;
}
& ilMDTaxonPath::getSourceLanguage ( )

Definition at line 89 of file class.ilMDTaxonPath.php.

{
return is_object($this->source_language) ? $this->source_language : false;
}
ilMDTaxonPath::getSourceLanguageCode ( )

Definition at line 93 of file class.ilMDTaxonPath.php.

Referenced by __getFields(), and toXML().

{
return is_object($this->source_language) ? $this->source_language->getLanguageCode() : false;
}

+ Here is the caller graph for this function:

ilMDTaxonPath::getSourceLanguageCode ( )

Definition at line 93 of file class.ilMDTaxonPath.php.

{
return is_object($this->source_language) ? $this->source_language->getLanguageCode() : false;
}
& ilMDTaxonPath::getTaxon (   $a_taxon_id)

Definition at line 49 of file class.ilMDTaxonPath.php.

Referenced by delete(), and toXML().

{
include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
if(!$a_taxon_id)
{
return false;
}
$tax =& new ilMDTaxon();
$tax->setMetaId($a_taxon_id);
return $tax;
}

+ Here is the caller graph for this function:

& ilMDTaxonPath::getTaxon (   $a_taxon_id)

Definition at line 49 of file class.ilMDTaxonPath.php.

{
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
if(!$a_taxon_id)
{
return false;
}
$tax =& new ilMDTaxon();
$tax->setMetaId($a_taxon_id);
return $tax;
}
& ilMDTaxonPath::getTaxonIds ( )

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

References _getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

{
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDTaxon.php';
return ilMDTaxon::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_taxon_path');
}

+ Here is the call graph for this function:

& ilMDTaxonPath::getTaxonIds ( )

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

References _getIds(), ilMDBase\getMetaId(), ilMDBase\getObjId(), and ilMDBase\getRBACId().

Referenced by delete(), and toXML().

{
include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
return ilMDTaxon::_getIds($this->getRBACId(),$this->getObjId(),$this->getMetaId(),'meta_taxon_path');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDTaxonPath::read ( )

Definition at line 163 of file class.ilMDTaxonPath.php.

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

{
global $ilDB;
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_taxon_path ".
"WHERE meta_taxon_path_id = ".$ilDB->quote($this->getMetaId() ,'integer');
$res = $ilDB->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->setSource($row->source);
$this->source_language = new ilMDLanguageItem($row->source_language);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDTaxonPath::read ( )

Definition at line 163 of file class.ilMDTaxonPath.php.

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

{
global $ilDB;
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_taxon_path ".
"WHERE meta_taxon_path_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);
$this->source_language = new ilMDLanguageItem($row->source_language);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDTaxonPath::save ( )

Reimplemented from ilMDBase.

Definition at line 99 of file class.ilMDTaxonPath.php.

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

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

+ Here is the call graph for this function:

ilMDTaxonPath::save ( )

Reimplemented from ilMDBase.

Definition at line 99 of file class.ilMDTaxonPath.php.

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

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

+ Here is the call graph for this function:

ilMDTaxonPath::setSource (   $a_source)

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

{
$this->source = $a_source;
}
ilMDTaxonPath::setSource (   $a_source)

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

Referenced by read().

{
$this->source = $a_source;
}

+ Here is the caller graph for this function:

ilMDTaxonPath::setSourceLanguage ( $lng_obj)

Definition at line 82 of file class.ilMDTaxonPath.php.

{
if(is_object($lng_obj))
{
$this->source_language = $lng_obj;
}
}
ilMDTaxonPath::setSourceLanguage ( $lng_obj)

Definition at line 82 of file class.ilMDTaxonPath.php.

{
if(is_object($lng_obj))
{
$this->source_language = $lng_obj;
}
}
ilMDTaxonPath::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 194 of file class.ilMDTaxonPath.php.

References getSource(), getSourceLanguageCode(), getTaxon(), and getTaxonIds().

{
$writer->xmlStartTag('TaxonPath');
$writer->xmlElement('Source',array('Language' => $this->getSourceLanguageCode()),$this->getSource());
// Taxon
foreach($this->getTaxonIds() as $id)
{
$tax =& $this->getTaxon($id);
$tax->toXML($writer);
}
$writer->xmlEndTag('TaxonPath');
}

+ Here is the call graph for this function:

ilMDTaxonPath::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 194 of file class.ilMDTaxonPath.php.

References ilMDBase\getObjId(), ilMDBase\getRBACId(), getSource(), getSourceLanguageCode(), getTaxon(), and getTaxonIds().

{
$writer->xmlStartTag('TaxonPath');
$writer->xmlElement('Source',array('Language' => $this->getSourceLanguageCode()
: 'en'),
$this->getSource());
// Taxon
$taxs = $this->getTaxonIds();
foreach($taxs as $id)
{
$tax =& $this->getTaxon($id);
$tax->toXML($writer);
}
if(!count($taxs))
{
include_once 'Services/MetaData/classes/class.ilMDTaxon.php';
$tax = new ilMDTaxon($this->getRBACId(),$this->getObjId());
$tax->toXML($writer);
}
$writer->xmlEndTag('TaxonPath');
}

+ Here is the call graph for this function:

ilMDTaxonPath::update ( )

Reimplemented from ilMDBase.

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

References $ilDB, and ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDTaxonPath::update ( )

Reimplemented from ilMDBase.

Definition at line 114 of file class.ilMDTaxonPath.php.

References $ilDB, and ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
if($this->db->update('il_meta_taxon_path',
$this->__getFields(),
array("meta_taxon_path_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: