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

Public Member Functions

 ilMDRights ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setCosts ($a_costs)
 getCosts ()
 setCopyrightAndOtherRestrictions ($a_caor)
 getCopyrightAndOtherRestrictions ()
 setDescription ($a_description)
 getDescription ()
 setDescriptionLanguage (&$lng_obj)
getDescriptionLanguage ()
 getDescriptionLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _lookupDescription ($a_rbac_id, $a_obj_id)
 Lookup description (copyright)
 _getId ($a_rbac_id, $a_obj_id)
 ilMDRights ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setCosts ($a_costs)
 getCosts ()
 setCopyrightAndOtherRestrictions ($a_caor)
 getCopyrightAndOtherRestrictions ()
 setDescription ($a_description)
 getDescription ()
 setDescriptionLanguage (&$lng_obj)
getDescriptionLanguage ()
 getDescriptionLanguageCode ()
 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 33 of file class.ilMDRights.php.

Member Function Documentation

ilMDRights::__getFields ( )

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

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), 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()),
'costs' => ilUtil::prepareDBString($this->getCosts()),
'copyright_and_other_restrictions' => ilUtil::prepareDBString($this->getCopyrightAndOtherRestrictions()),
'description' => ilUtil::prepareDBString($this->getDescription()),
'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
}

+ Here is the call graph for this function:

ilMDRights::__getFields ( )

Definition at line 149 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), 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()),
'costs' => array('text',$this->getCosts()),
'cpr_and_or' => array('text',$this->getCopyrightAndOtherRestrictions()),
'description' => array('text',$this->getDescription()),
'description_language' => array('text',$this->getDescriptionLanguageCode()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDRights::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 203 of file class.ilMDRights.php.

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

{
global $ilDB;
$query = "SELECT meta_rights_id FROM il_meta_rights ".
"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_rights_id;
}
return false;
}
ilMDRights::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 231 of file class.ilMDRights.php.

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

Referenced by ilMD\getRights().

{
global $ilDB;
$query = "SELECT meta_rights_id FROM il_meta_rights ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->meta_rights_id;
}
return false;
}

+ Here is the caller graph for this function:

ilMDRights::_lookupDescription (   $a_rbac_id,
  $a_obj_id 
)

Lookup description (copyright)

public

Parameters
intrbac_id
intobj_id

Definition at line 218 of file class.ilMDRights.php.

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

Referenced by ilMDCopyrightSelectionGUI\fillTemplate(), and ilMDEditorGUI\initQuickEditForm().

{
global $ilDB;
$query = "SELECT description FROM il_meta_rights ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id ,'integer')." ".
"AND obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
$res = $ilDB->query($query);
return $row->description ? $row->description : '';
}

+ Here is the caller graph for this function:

ilMDRights::delete ( )

Reimplemented from ilMDBase.

Definition at line 131 of file class.ilMDRights.php.

References $query, and ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDRights::delete ( )

Reimplemented from ilMDBase.

Definition at line 132 of file class.ilMDRights.php.

References $query, and ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDRights::getCopyrightAndOtherRestrictions ( )

Definition at line 73 of file class.ilMDRights.php.

{
return $this->caor;
}
ilMDRights::getCopyrightAndOtherRestrictions ( )

Definition at line 73 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

{
return $this->caor;
}

+ Here is the caller graph for this function:

ilMDRights::getCosts ( )

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

Referenced by __getFields(), and toXML().

{
return $this->costs;
}

+ Here is the caller graph for this function:

ilMDRights::getCosts ( )

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

{
return $this->costs;
}
ilMDRights::getDescription ( )

Definition at line 81 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

{
return $this->description;
}

+ Here is the caller graph for this function:

ilMDRights::getDescription ( )

Definition at line 81 of file class.ilMDRights.php.

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

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

{
return is_object($this->description_language) ? $this->description_language : false;
}
& ilMDRights::getDescriptionLanguage ( )

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

{
return is_object($this->description_language) ? $this->description_language : false;
}
ilMDRights::getDescriptionLanguageCode ( )

Definition at line 96 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

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

+ Here is the caller graph for this function:

ilMDRights::getDescriptionLanguageCode ( )

Definition at line 96 of file class.ilMDRights.php.

{
return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
}
ilMDRights::ilMDRights (   $a_rbac_id = 0,
  $a_obj_id = 0,
  $a_obj_type = '' 
)

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDRights::read ( )

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

References $query, $res, $row, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), 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_rights ".
"WHERE meta_rights_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->setDescription(ilUtil::stripSlashes($row->description));
$this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
$this->setCopyrightAndOtherRestrictions(ilUtil::stripSlashes($row->copyright_and_other_restrictions));
}
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDRights::read ( )

Definition at line 160 of file class.ilMDRights.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), 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_rights ".
"WHERE meta_rights_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->setDescription($row->description);
$this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
$this->setCosts($row->costs);
}
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMDRights::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDRights::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDRights::setCopyrightAndOtherRestrictions (   $a_caor)

Definition at line 60 of file class.ilMDRights.php.

Referenced by read().

{
switch($a_caor)
{
case 'Yes':
case 'No':
$this->caor = $a_caor;
return true;
default:
return false;
}
}

+ Here is the caller graph for this function:

ilMDRights::setCopyrightAndOtherRestrictions (   $a_caor)

Definition at line 60 of file class.ilMDRights.php.

{
switch($a_caor)
{
case 'Yes':
case 'No':
$this->caor = $a_caor;
return true;
default:
return false;
}
}
ilMDRights::setCosts (   $a_costs)

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

Referenced by read().

{
switch($a_costs)
{
case 'Yes':
case 'No':
$this->costs = $a_costs;
return true;
default:
return false;
}
}

+ Here is the caller graph for this function:

ilMDRights::setCosts (   $a_costs)

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

{
switch($a_costs)
{
case 'Yes':
case 'No':
$this->costs = $a_costs;
return true;
default:
return false;
}
}
ilMDRights::setDescription (   $a_description)

Definition at line 77 of file class.ilMDRights.php.

Referenced by read().

{
$this->description = $a_description;
}

+ Here is the caller graph for this function:

ilMDRights::setDescription (   $a_description)

Definition at line 77 of file class.ilMDRights.php.

{
$this->description = $a_description;
}
ilMDRights::setDescriptionLanguage ( $lng_obj)

Definition at line 85 of file class.ilMDRights.php.

Referenced by read().

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

+ Here is the caller graph for this function:

ilMDRights::setDescriptionLanguage ( $lng_obj)

Definition at line 85 of file class.ilMDRights.php.

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

Reimplemented from ilMDBase.

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

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), and getDescriptionLanguageCode().

{
$writer->xmlStartTag('Rights',array('Costs' => $this->getCosts(),
'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()));
$writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()),$this->getDescription());
$writer->xmlEndTag('Rights');
}

+ Here is the call graph for this function:

ilMDRights::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 195 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), and getDescriptionLanguageCode().

{
$writer->xmlStartTag('Rights',array('Cost' => $this->getCosts()
? $this->getCosts()
: 'No',
'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()
: 'No'));
$writer->xmlElement('Description',array('Language' => $this->getDescriptionLanguageCode()
: 'en'),
$this->getDescription());
$writer->xmlEndTag('Rights');
}

+ Here is the call graph for this function:

ilMDRights::update ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDRights::update ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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