ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDTypicalAgeRange Class Reference
+ Inheritance diagram for ilMDTypicalAgeRange:
+ Collaboration diagram for ilMDTypicalAgeRange:

Public Member Functions

 ilMDTypicalAgeRange ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setTypicalAgeRange ($a_typical_age_range)
 getTypicalAgeRange ()
 setTypicalAgeRangeLanguage (&$lng_obj)
getTypicalAgeRangeLanguage ()
 getTypicalAgeRangeLanguageCode ()
 setTypicalAgeRangeMinimum ($a_min)
 getTypicalAgeRangeMinimum ()
 setTypicalAgeRangeMaximum ($a_max)
 getTypicalAgeRangeMaximum ()
 save ()
 update ()
 delete ()
 __getFields ()
 read ()
 toXML (&$writer)
 _getIds ($a_rbac_id, $a_obj_id, $a_parent_id, $a_parent_type)
 __parseTypicalAgeRange ()
 ilMDTypicalAgeRange ($a_rbac_id=0, $a_obj_id=0, $a_obj_type= '')
 setTypicalAgeRange ($a_typical_age_range)
 getTypicalAgeRange ()
 setTypicalAgeRangeLanguage (&$lng_obj)
getTypicalAgeRangeLanguage ()
 getTypicalAgeRangeLanguageCode ()
 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.ilMDTypicalAgeRange.php.

Member Function Documentation

ilMDTypicalAgeRange::__getFields ( )

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

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), getTypicalAgeRange(), getTypicalAgeRangeLanguageCode(), 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(),
'typical_age_range' => ilUtil::prepareDBString($this->getTypicalAgeRange()),
'typical_age_range_language' => ilUtil::prepareDBString($this->getTypicalAgeRangeLanguageCode()));
}

+ Here is the call graph for this function:

ilMDTypicalAgeRange::__getFields ( )

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

References ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getParentId(), ilMDBase\getParentType(), ilMDBase\getRBACId(), getTypicalAgeRange(), getTypicalAgeRangeLanguageCode(), getTypicalAgeRangeMaximum(), and getTypicalAgeRangeMinimum().

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()),
'typical_age_range' => array('text',$this->getTypicalAgeRange()),
'tar_language' => array('text',$this->getTypicalAgeRangeLanguageCode()),
'tar_min' => array('text',$this->getTypicalAgeRangeMinimum()),
'tar_max' => array('text',$this->getTypicalAgeRangeMaximum()));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::__parseTypicalAgeRange ( )

Definition at line 207 of file class.ilMDTypicalAgeRange.php.

References getTypicalAgeRange(), setTypicalAgeRangeMaximum(), and setTypicalAgeRangeMinimum().

Referenced by update().

{
if(preg_match("/\s*(\d*)\s*(-?)\s*(\d*)/",$this->getTypicalAgeRange(),$matches))
{
if(!$matches[2] and !$matches[3])
{
$min = $max = $matches[1];
}
elseif($matches[2] and !$matches[3])
{
$min = $matches[1];
$max = 99;
}
else
{
$min = $matches[1];
$max = $matches[3];
}
return true;
}
if(!$this->getTypicalAgeRange())
{
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

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

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

Definition at line 188 of file class.ilMDTypicalAgeRange.php.

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

Referenced by ilMDEducational\getTypicalAgeRangeIds().

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

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::delete ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDTypicalAgeRange::delete ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDTypicalAgeRange::getTypicalAgeRange ( )

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

{
return $this->typical_age_range;
}
ilMDTypicalAgeRange::getTypicalAgeRange ( )

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

Referenced by __getFields(), __parseTypicalAgeRange(), and toXML().

{
return $this->typical_age_range;
}

+ Here is the caller graph for this function:

& ilMDTypicalAgeRange::getTypicalAgeRangeLanguage ( )

Definition at line 58 of file class.ilMDTypicalAgeRange.php.

{
return is_object($this->typical_age_range_language) ? $this->typical_age_range_language : false;
}
& ilMDTypicalAgeRange::getTypicalAgeRangeLanguage ( )

Definition at line 58 of file class.ilMDTypicalAgeRange.php.

{
return is_object($this->typical_age_range_language) ? $this->typical_age_range_language : false;
}
ilMDTypicalAgeRange::getTypicalAgeRangeLanguageCode ( )

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

{
return is_object($this->typical_age_range_language) ? $this->typical_age_range_language->getLanguageCode() : false;
}
ilMDTypicalAgeRange::getTypicalAgeRangeLanguageCode ( )

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

Referenced by __getFields(), and toXML().

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

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::getTypicalAgeRangeMaximum ( )

Definition at line 79 of file class.ilMDTypicalAgeRange.php.

Referenced by __getFields().

{
return $this->typical_age_range_maximum;
}

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::getTypicalAgeRangeMinimum ( )

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

Referenced by __getFields().

{
return $this->typical_age_range_minimum;
}

+ Here is the caller graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

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

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

References ilMDBase\ilMDBase().

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

+ Here is the call graph for this function:

ilMDTypicalAgeRange::read ( )

Definition at line 125 of file class.ilMDTypicalAgeRange.php.

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

{
global $ilDB;
include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_typical_age_range ".
"WHERE meta_typical_age_range_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->setTypicalAgeRange(ilUtil::stripSlashes($row->typical_age_range));
$this->setTypicalAgeRangeLanguage(new ilMDLanguageItem($row->typical_age_range_language));
}
}
return true;
}

+ Here is the call graph for this function:

ilMDTypicalAgeRange::read ( )

Definition at line 145 of file class.ilMDTypicalAgeRange.php.

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

{
global $ilDB;
include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
if($this->getMetaId())
{
$query = "SELECT * FROM il_meta_tar ".
"WHERE meta_tar_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->setTypicalAgeRange($row->typical_age_range);
$this->setTypicalAgeRangeLanguage(new ilMDLanguageItem($row->tar_language));
$this->setTypicalAgeRangeMinimum($row->tar_min);
$this->setTypicalAgeRangeMaximum($row->tar_max);
}
}
return true;
}

+ Here is the call graph for this function:

ilMDTypicalAgeRange::save ( )

Reimplemented from ilMDBase.

Definition at line 67 of file class.ilMDTypicalAgeRange.php.

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

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

+ Here is the call graph for this function:

ilMDTypicalAgeRange::save ( )

Reimplemented from ilMDBase.

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

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

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

+ Here is the call graph for this function:

ilMDTypicalAgeRange::setTypicalAgeRange (   $a_typical_age_range)

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

{
$this->typical_age_range = $a_typical_age_range;
}
ilMDTypicalAgeRange::setTypicalAgeRange (   $a_typical_age_range)

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

Referenced by read().

{
$this->typical_age_range = $a_typical_age_range;
}

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::setTypicalAgeRangeLanguage ( $lng_obj)

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

Referenced by read().

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

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::setTypicalAgeRangeLanguage ( $lng_obj)

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

{
if(is_object($lng_obj))
{
$this->typical_age_range_language = $lng_obj;
}
}
ilMDTypicalAgeRange::setTypicalAgeRangeMaximum (   $a_max)

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

Referenced by __parseTypicalAgeRange(), and read().

{
$this->typical_age_range_maximum = $a_max;
}

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::setTypicalAgeRangeMinimum (   $a_min)

Definition at line 67 of file class.ilMDTypicalAgeRange.php.

Referenced by __parseTypicalAgeRange(), and read().

{
$this->typical_age_range_minimum = $a_min;
}

+ Here is the caller graph for this function:

ilMDTypicalAgeRange::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 156 of file class.ilMDTypicalAgeRange.php.

References getTypicalAgeRange(), and getTypicalAgeRangeLanguageCode().

{
$writer->xmlElement('TypicalAgeRange',array('Language' => $this->getTypicalAgeRangeLanguageCode()),$this->getTypicalAgeRange());
}

+ Here is the call graph for this function:

ilMDTypicalAgeRange::toXML ( $writer)

Reimplemented from ilMDBase.

Definition at line 178 of file class.ilMDTypicalAgeRange.php.

References getTypicalAgeRange(), and getTypicalAgeRangeLanguageCode().

{
$writer->xmlElement('TypicalAgeRange',array('Language' => $this->getTypicalAgeRangeLanguageCode()
: 'en'),
$this->getTypicalAgeRange());
}

+ Here is the call graph for this function:

ilMDTypicalAgeRange::update ( )

Reimplemented from ilMDBase.

Definition at line 80 of file class.ilMDTypicalAgeRange.php.

References $ilDB, and ilMDBase\getMetaId().

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

+ Here is the call graph for this function:

ilMDTypicalAgeRange::update ( )

Reimplemented from ilMDBase.

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

References $ilDB, __parseTypicalAgeRange(), and ilMDBase\getMetaId().

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