ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDIdentifier Class Reference
+ Inheritance diagram for ilMDIdentifier:
+ Collaboration diagram for ilMDIdentifier:

Public Member Functions

 ilMDIdentifier ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setCatalog ($a_catalog)
 getCatalog ()
 setEntry ($a_entry)
 getEntry ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer, $a_overwrite_id=false)
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 ilMDIdentifier ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setCatalog ($a_catalog)
 getCatalog ()
 setEntry ($a_entry)
 getEntry ()
 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 ()

Static Public Member Functions

static _getEntriesForObj ($a_rbac_id, $a_obj_id, $a_obj_type)
 Get IDs for an object.
static _getEntriesForRbacObj ($a_rbac_id, $a_obj_type="")
 Get IDs for an rbac object.
static existsIdInRbacObject ($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
 Does id entry exist in rbac object?
static readIdData ($a_rbac_id, $a_obj_type, $a_catalog, $a_entry)
 Does id entry exist in rbac object?

Additional Inherited Members

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

Detailed Description

Definition at line 32 of file class.ilMDIdentifier.php.

Member Function Documentation

ilMDIdentifier::__getFields ( )

Definition at line 107 of file class.ilMDIdentifier.php.

References getCatalog(), getEntry(), 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()),
'catalog' => array('text',$this->getCatalog()),
'entry' => array('text',$this->getEntry()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDIdentifier::__getFields ( )

Definition at line 109 of file class.ilMDIdentifier.php.

References getCatalog(), getEntry(), 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(),
'catalog' => ilUtil::prepareDBString($this->getCatalog()),
'entry' => ilUtil::prepareDBString($this->getEntry()));
}

+ Here is the call graph for this function:

static ilMDIdentifier::_getEntriesForObj (   $a_rbac_id,
  $a_obj_id,
  $a_obj_type 
)
static

Get IDs for an object.

Parameters
@return

Definition at line 200 of file class.ilMDIdentifier.php.

References $query, and $res.

Referenced by ilLMObject\getExportId(), and ilLMObject\saveExportId().

{
global $ilDB;
$query = "SELECT meta_identifier_id, catalog, entry FROM il_meta_identifier ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ".
"AND obj_type = ".$ilDB->quote($a_obj_type ,'text');
$res = $ilDB->query($query);
$entries = array();
while($r = $ilDB->fetchAssoc($res))
{
$entries[$r["meta_identifier_id"]] =
array("catalog" => $r["catalog"],
"entry" => $r["entry"]);
}
return $entries;
}

+ Here is the caller graph for this function:

static ilMDIdentifier::_getEntriesForRbacObj (   $a_rbac_id,
  $a_obj_type = "" 
)
static

Get IDs for an rbac object.

Parameters
@return

Definition at line 226 of file class.ilMDIdentifier.php.

References $query, and $res.

Referenced by ilLMObject\getDuplicateExportIDs().

{
global $ilDB;
$query = "SELECT meta_identifier_id, catalog, entry, obj_id FROM il_meta_identifier ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer');
if ($a_obj_type != "")
{
" AND obj_type = ".$ilDB->quote($a_obj_type ,'text');
}
$res = $ilDB->query($query);
$entries = array();
while($r = $ilDB->fetchAssoc($res))
{
$entries[$r["meta_identifier_id"]] =
array("catalog" => $r["catalog"],
"entry" => $r["entry"],
"obj_id" => $r["obj_id"]);
}
return $entries;
}

+ Here is the caller graph for this function:

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

Definition at line 158 of file class.ilMDIdentifier.php.

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

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

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

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

Referenced by ilMDMetaMetadata\getIdentifierIds(), and ilMDGeneral\getIdentifierIds().

{
global $ilDB;
$query = "SELECT meta_identifier_id FROM il_meta_identifier ".
"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_identifier_id;
}
return $ids ? $ids : array();
}

+ Here is the caller graph for this function:

ilMDIdentifier::delete ( )

Reimplemented from ilMDBase.

Definition at line 92 of file class.ilMDIdentifier.php.

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

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

+ Here is the call graph for this function:

ilMDIdentifier::delete ( )

Reimplemented from ilMDBase.

Definition at line 92 of file class.ilMDIdentifier.php.

References $query, and ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

static ilMDIdentifier::existsIdInRbacObject (   $a_rbac_id,
  $a_obj_type,
  $a_catalog,
  $a_entry 
)
static

Does id entry exist in rbac object?

Parameters
@return

Definition at line 257 of file class.ilMDIdentifier.php.

References $query.

Referenced by ilLMObject\existsExportID().

{
global $ilDB;
$query = "SELECT meta_identifier_id, obj_id FROM il_meta_identifier ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id , 'integer').
" AND obj_type = ".$ilDB->quote($a_obj_type , 'text').
" AND catalog = ".$ilDB->quote($a_catalog , 'text').
" AND entry = ".$ilDB->quote($a_entry , 'text');
$s = $ilDB->query($query);
if ($r = $ilDB->fetchAssoc($s))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilMDIdentifier::getCatalog ( )

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

Referenced by __getFields(), and toXML().

{
return $this->catalog;
}

+ Here is the caller graph for this function:

ilMDIdentifier::getCatalog ( )

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

{
return $this->catalog;
}
ilMDIdentifier::getEntry ( )

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

Referenced by __getFields(), and toXML().

{
return $this->entry;
}

+ Here is the caller graph for this function:

ilMDIdentifier::getEntry ( )

Definition at line 56 of file class.ilMDIdentifier.php.

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDIdentifier::read ( )

Definition at line 119 of file class.ilMDIdentifier.php.

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

{
global $ilDB;
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_identifier ".
"WHERE meta_identifier_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->setCatalog($row->catalog);
$this->setEntry($row->entry);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDIdentifier::read ( )

Definition at line 121 of file class.ilMDIdentifier.php.

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

{
global $ilDB;
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_identifier ".
"WHERE meta_identifier_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:

static ilMDIdentifier::readIdData (   $a_rbac_id,
  $a_obj_type,
  $a_catalog,
  $a_entry 
)
static

Does id entry exist in rbac object?

Parameters
@return

Definition at line 280 of file class.ilMDIdentifier.php.

References $data, and $query.

Referenced by ilLMObject\getExportIDInfo().

{
global $ilDB;
$query = "SELECT * FROM il_meta_identifier ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id , 'integer').
" AND obj_type = ".$ilDB->quote($a_obj_type , 'text').
" AND catalog = ".$ilDB->quote($a_catalog , 'text').
" AND entry = ".$ilDB->quote($a_entry , 'text');
$s = $ilDB->query($query);
$data = array();
while ($r = $ilDB->fetchAssoc($s))
{
$data[] = $r;
}
return $data;
}

+ Here is the caller graph for this function:

ilMDIdentifier::save ( )

Reimplemented from ilMDBase.

Definition at line 61 of file class.ilMDIdentifier.php.

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

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

+ Here is the call graph for this function:

ilMDIdentifier::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDIdentifier::setCatalog (   $a_catalog)

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

Referenced by read().

{
$this->catalog = $a_catalog;
}

+ Here is the caller graph for this function:

ilMDIdentifier::setCatalog (   $a_catalog)

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

{
$this->catalog = $a_catalog;
}
ilMDIdentifier::setEntry (   $a_entry)

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

Referenced by read().

{
$this->entry = $a_entry;
}

+ Here is the caller graph for this function:

ilMDIdentifier::setEntry (   $a_entry)

Definition at line 52 of file class.ilMDIdentifier.php.

{
$this->entry = $a_entry;
}
ilMDIdentifier::toXML ( $writer,
  $a_overwrite_id = false 
)

Definition at line 148 of file class.ilMDIdentifier.php.

References getCatalog(), getEntry(), ilMDBase\getExportMode(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

{
$entry_default = ($this->getObjId() == 0)
? "il_".IL_INST_ID."_".$this->getObjType()."_".$this->getRBACId()
: "il_".IL_INST_ID."_".$this->getObjType()."_".$this->getObjId();
$entry = $this->getEntry() ? $this->getEntry() : $entry_default;
$catalog = $this->getCatalog();
if ($this->getExportMode() && $this->getCatalog() != "ILIAS_NID")
{
$entry = $entry_default;
$catalog = "ILIAS";
}
if(strlen($catalog))
{
$writer->xmlElement('Identifier',array('Catalog' => $catalog,
'Entry' => $entry));
}
else
{
$writer->xmlElement('Identifier',array('Entry' => $entry));
}
}

+ Here is the call graph for this function:

ilMDIdentifier::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 150 of file class.ilMDIdentifier.php.

References getCatalog(), and getEntry().

{
$writer->xmlElement('Identifier',array('Catalog' => $this->getCatalog(),
'Entry' => $this->getEntry()));
}

+ Here is the call graph for this function:

ilMDIdentifier::update ( )

Reimplemented from ilMDBase.

Definition at line 75 of file class.ilMDIdentifier.php.

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDIdentifier::update ( )

Reimplemented from ilMDBase.

Definition at line 76 of file class.ilMDIdentifier.php.

References ilMDBase\getMetaId().

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