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

Public Member Functions

 ilMDLanguage ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setLanguage (&$lng_obj)
getLanguage ()
 getLanguageCode ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 ilMDLanguage ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setLanguage (&$lng_obj)
getLanguage ()
 getLanguageCode ()
 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 _lookupFirstLanguage ($a_rbac_id, $a_obj_id, $a_obj_type)
 Lookup first language.

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.ilMDLanguage.php.

Member Function Documentation

ilMDLanguage::__getFields ( )

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

References getLanguageCode(), 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(),
'language' => ilUtil::prepareDBString($this->getLanguageCode()));
}

+ Here is the call graph for this function:

ilMDLanguage::__getFields ( )

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

References getLanguageCode(), 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(),
'language' => $this->getLanguageCode());
}

+ Here is the call graph for this function:

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

Definition at line 154 of file class.ilMDLanguage.php.

References $res, and DB_FETCHMODE_OBJECT.

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

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

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilMDGeneral\getLanguageIds(), and ilMDEducational\getLanguageIds().

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

+ Here is the caller graph for this function:

static ilMDLanguage::_lookupFirstLanguage (   $a_rbac_id,
  $a_obj_id,
  $a_obj_type 
)
static

Lookup first language.

public

Parameters

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

References $lang, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilECSContentWriter\updateJSON().

{
global $ilDB;
$lang = '';
$query = "SELECT language FROM il_meta_language ".
"WHERE rbac_id = ".$ilDB->quote($a_rbac_id)." ".
"AND obj_id = ".$ilDB->quote($a_obj_id)." ".
"AND obj_type = ".$ilDB->quote($a_obj_type)." ".
"AND parent_type = 'meta_general' ".
"ORDER BY meta_language_id LIMIT 1 ";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$lang = $row->language;
}
return $lang;
}

+ Here is the caller graph for this function:

ilMDLanguage::delete ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDLanguage::delete ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

& ilMDLanguage::getLanguage ( )

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

{
return is_object($this->language) ? $this->language : false;
}
& ilMDLanguage::getLanguage ( )

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

Referenced by toXML().

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

+ Here is the caller graph for this function:

ilMDLanguage::getLanguageCode ( )

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

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

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

Referenced by __getFields(), and toXML().

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

+ Here is the caller graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDLanguage::read ( )

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

References $res, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), and ilMDBase\setRBACId().

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

+ Here is the call graph for this function:

ilMDLanguage::read ( )

Definition at line 144 of file class.ilMDLanguage.php.

References $res, DB_FETCHMODE_OBJECT, ilMDBase\getMetaId(), setLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setParentId(), ilMDBase\setParentType(), and ilMDBase\setRBACId().

{
global $ilDB;
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_language ".
"WHERE meta_language_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->setLanguage(new ilMDLanguageItem($row->language));
}
}
return true;
}

+ Here is the call graph for this function:

ilMDLanguage::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDLanguage::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDLanguage::setLanguage ( $lng_obj)

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

{
if(is_object($lng_obj))
{
$this->language =& $lng_obj;
}
}
ilMDLanguage::setLanguage ( $lng_obj)

Definition at line 71 of file class.ilMDLanguage.php.

Referenced by read().

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

+ Here is the caller graph for this function:

ilMDLanguage::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 147 of file class.ilMDLanguage.php.

References getLanguage(), and getLanguageCode().

{
$writer->xmlElement('Language',array('Language' => $this->getLanguageCode()),$this->getLanguage());
}

+ Here is the call graph for this function:

ilMDLanguage::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 174 of file class.ilMDLanguage.php.

References getLanguage(), and getLanguageCode().

{
$writer->xmlElement('Language',array('Language' => $this->getLanguageCode() ?
$this->getLanguageCode() :
'en'),
$this->getLanguage());
}

+ Here is the call graph for this function:

ilMDLanguage::update ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDLanguage::update ( )

Reimplemented from ilMDBase.

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

References ilMDBase\getMetaId().

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