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

Public Member Functions

 ilMDLifecycle ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 getPossibleSubelements ()
getContributeIds ()
getContribute ($a_contribute_id)
addContribute ()
 setStatus ($a_status)
 getStatus ()
 setVersion ($a_version)
 getVersion ()
 setVersionLanguage ($lng_obj)
getVersionLanguage ()
 getVersionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getId ($a_rbac_id, $a_obj_id)
 ilMDLifecycle ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
getContributeIds ()
getContribute ($a_contribute_id)
addContribute ()
 setStatus ($a_status)
 getStatus ()
 setVersion ($a_version)
 getVersion ()
 setVersionLanguage ($lng_obj)
getVersionLanguage ()
 getVersionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getId ($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 34 of file class.ilMDLifecycle.php.

Member Function Documentation

ilMDLifecycle::__getFields ( )

Definition at line 177 of file class.ilMDLifecycle.php.

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getStatus(), getVersion(), getVersionLanguageCode(), and ilUtil\prepareDBString().

{
return array('rbac_id' => $this->getRBACId(),
'obj_id' => $this->getObjId(),
'obj_type' => ilUtil::prepareDBString($this->getObjType()),
'lifecycle_status' => ilUtil::prepareDBString($this->getStatus()),
'meta_version' => ilUtil::prepareDBString($this->getVersion()),
'version_language' => ilUtil::prepareDBString($this->getVersionLanguageCode()));
}

+ Here is the call graph for this function:

ilMDLifecycle::__getFields ( )

Definition at line 184 of file class.ilMDLifecycle.php.

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), getStatus(), getVersion(), getVersionLanguageCode(), and ilUtil\prepareDBString().

{
return array('rbac_id' => $this->getRBACId(),
'obj_id' => $this->getObjId(),
'obj_type' => ilUtil::prepareDBString($this->getObjType()),
'lifecycle_status' => $this->getStatus(),
'meta_version' => $this->getVersion(),
'version_language' => $this->getVersionLanguageCode());
}

+ Here is the call graph for this function:

ilMDLifecycle::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 235 of file class.ilMDLifecycle.php.

References $res, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
$query = "SELECT meta_lifecycle_id FROM il_meta_lifecycle ".
"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))
{
return $row->meta_lifecycle_id;
}
return false;
}
ilMDLifecycle::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 253 of file class.ilMDLifecycle.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilMD\getLifecycle().

{
global $ilDB;
$query = "SELECT meta_lifecycle_id FROM il_meta_lifecycle ".
"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))
{
return $row->meta_lifecycle_id;
}
return false;
}

+ Here is the caller graph for this function:

& ilMDLifecycle::addContribute ( )

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

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

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

+ Here is the call graph for this function:

& ilMDLifecycle::addContribute ( )

Definition at line 70 of file class.ilMDLifecycle.php.

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

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

+ Here is the call graph for this function:

ilMDLifecycle::delete ( )

Reimplemented from ilMDBase.

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

References getContribute(), getContributeIds(), and ilMDBase\getMetaId().

{
global $ilDB;
// Delete 'contribute'
foreach($this->getContributeIds() as $id)
{
$con = $this->getContribute($id);
$con->delete();
}
if($this->getMetaId())
{
$query = "DELETE FROM il_meta_lifecycle ".
"WHERE meta_lifecycle_id = ".$ilDB->quote($this->getMetaId());
$this->db->query($query);
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDLifecycle::delete ( )

Reimplemented from ilMDBase.

Definition at line 159 of file class.ilMDLifecycle.php.

References getContribute(), getContributeIds(), and ilMDBase\getMetaId().

{
global $ilDB;
// Delete 'contribute'
foreach($this->getContributeIds() as $id)
{
$con = $this->getContribute($id);
$con->delete();
}
if($this->getMetaId())
{
$query = "DELETE FROM il_meta_lifecycle ".
"WHERE meta_lifecycle_id = ".$ilDB->quote($this->getMetaId());
$this->db->query($query);
return true;
}
return false;
}

+ Here is the call graph for this function:

& ilMDLifecycle::getContribute (   $a_contribute_id)

Definition at line 50 of file class.ilMDLifecycle.php.

{
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDContribute.php';
if(!$a_contribute_id)
{
return false;
}
$con =& new ilMDContribute();
$con->setMetaId($a_contribute_id);
return $con;
}
& ilMDLifecycle::getContribute (   $a_contribute_id)

Definition at line 57 of file class.ilMDLifecycle.php.

Referenced by delete(), and toXML().

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

+ Here is the caller graph for this function:

& ilMDLifecycle::getContributeIds ( )

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

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

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

+ Here is the call graph for this function:

& ilMDLifecycle::getContributeIds ( )

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

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

Referenced by delete(), and toXML().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDLifecycle::getPossibleSubelements ( )

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

{
$subs['Contribute'] = 'meta_contribute';
return $subs;
}
ilMDLifecycle::getStatus ( )

Definition at line 90 of file class.ilMDLifecycle.php.

{
return $this->status;
}
ilMDLifecycle::getStatus ( )

Definition at line 97 of file class.ilMDLifecycle.php.

Referenced by __getFields(), and toXML().

{
return $this->status;
}

+ Here is the caller graph for this function:

ilMDLifecycle::getVersion ( )

Definition at line 98 of file class.ilMDLifecycle.php.

{
return $this->version;
}
ilMDLifecycle::getVersion ( )

Definition at line 105 of file class.ilMDLifecycle.php.

Referenced by __getFields(), and toXML().

{
return $this->version;
}

+ Here is the caller graph for this function:

& ilMDLifecycle::getVersionLanguage ( )

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

{
return $this->version_language;
}
& ilMDLifecycle::getVersionLanguage ( )

Definition at line 116 of file class.ilMDLifecycle.php.

{
return $this->version_language;
}
ilMDLifecycle::getVersionLanguageCode ( )

Definition at line 113 of file class.ilMDLifecycle.php.

{
if(is_object($this->version_language))
{
return $this->version_language->getLanguageCode();
}
return false;
}
ilMDLifecycle::getVersionLanguageCode ( )

Definition at line 120 of file class.ilMDLifecycle.php.

Referenced by __getFields(), and toXML().

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

+ Here is the caller graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDLifecycle::read ( )

Definition at line 187 of file class.ilMDLifecycle.php.

References $res, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), setStatus(), setVersion(), setVersionLanguage(), and ilUtil\stripSlashes().

{
global $ilDB;
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_lifecycle ".
"WHERE meta_lifecycle_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->setStatus(ilUtil::stripSlashes($row->lifecycle_status));
$this->setVersion(ilUtil::stripSlashes($row->meta_version));
$this->setVersionLanguage(new ilMDLanguageItem($row->version_language));
}
}
return true;
}

+ Here is the call graph for this function:

ilMDLifecycle::read ( )

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

References $res, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), setStatus(), setVersion(), and setVersionLanguage().

{
global $ilDB;
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_lifecycle ".
"WHERE meta_lifecycle_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->setStatus($row->lifecycle_status);
$this->setVersion($row->meta_version);
$this->setVersionLanguage(new ilMDLanguageItem($row->version_language));
}
}
return true;
}

+ Here is the call graph for this function:

ilMDLifecycle::save ( )

Reimplemented from ilMDBase.

Definition at line 122 of file class.ilMDLifecycle.php.

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

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

+ Here is the call graph for this function:

ilMDLifecycle::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDLifecycle::setStatus (   $a_status)

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

{
switch($a_status)
{
case 'Draft':
case 'Final':
case 'Revised':
case 'Unavailable':
$this->status = $a_status;
default:
return false;
}
}
ilMDLifecycle::setStatus (   $a_status)

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

Referenced by read().

{
switch($a_status)
{
case 'Draft':
case 'Final':
case 'Revised':
case 'Unavailable':
$this->status = $a_status;
default:
return false;
}
}

+ Here is the caller graph for this function:

ilMDLifecycle::setVersion (   $a_version)

Definition at line 94 of file class.ilMDLifecycle.php.

{
$this->version = $a_version;
}
ilMDLifecycle::setVersion (   $a_version)

Definition at line 101 of file class.ilMDLifecycle.php.

Referenced by read().

{
$this->version = $a_version;
}

+ Here is the caller graph for this function:

ilMDLifecycle::setVersionLanguage (   $lng_obj)

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

{
if(is_object($lng_obj))
{
$this->version_language =& $lng_obj;
}
}
ilMDLifecycle::setVersionLanguage (   $lng_obj)

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

Referenced by read().

{
if(is_object($lng_obj))
{
$this->version_language =& $lng_obj;
}
}

+ Here is the caller graph for this function:

ilMDLifecycle::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 217 of file class.ilMDLifecycle.php.

References getContribute(), getContributeIds(), getStatus(), getVersion(), and getVersionLanguageCode().

{
$writer->xmlStartTag('Lifecycle',array('Status' => $this->getStatus()));
$writer->xmlElement('Version',array('Language' => $this->getVersionLanguageCode()),$this->getVersion());
// contribute
foreach($this->getContributeIds() as $id)
{
$con =& $this->getContribute($id);
$con->toXML($writer);
}
$writer->xmlEndTag('Lifecycle');
}

+ Here is the call graph for this function:

ilMDLifecycle::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 224 of file class.ilMDLifecycle.php.

References getContribute(), getContributeIds(), ilMDBase\getObjId(), ilMDBase\getRBACId(), getStatus(), getVersion(), and getVersionLanguageCode().

{
$writer->xmlStartTag('Lifecycle',array('Status' => $this->getStatus()
? $this->getStatus()
: 'Draft'));
$writer->xmlElement('Version',array('Language' => $this->getVersionLanguageCode()
: 'en'),
$this->getVersion());
// contribute
$contributes = $this->getContributeIds();
foreach($contributes as $id)
{
$con =& $this->getContribute($id);
$con->toXML($writer);
}
if(!count($contributes))
{
include_once 'Services/MetaData/classes/class.ilMDContribute.php';
$con = new ilMDContribute($this->getRBACId(),$this->getObjId());
$con->toXML($writer);
}
$writer->xmlEndTag('Lifecycle');
}

+ Here is the call graph for this function:

ilMDLifecycle::update ( )

Reimplemented from ilMDBase.

Definition at line 135 of file class.ilMDLifecycle.php.

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDLifecycle::update ( )

Reimplemented from ilMDBase.

Definition at line 142 of file class.ilMDLifecycle.php.

References ilMDBase\getMetaId().

{
global $ilDB;
if($this->getMetaId())
{
if($this->db->autoExecute('il_meta_lifecycle',
$this->__getFields(),
DB_AUTOQUERY_UPDATE,
"meta_lifecycle_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: