Class ilUserDefinedData. More...
Public Member Functions | |
| ilUserDefinedData ($a_usr_id) | |
| getUserId () | |
| set ($a_field, $a_value) | |
| get ($a_field) | |
| update () | |
| toXML () | |
| addToXML ($xml_writer) | |
| add user defined field data to xml (using usr dtd) | |
| __read () | |
Data Fields | |
| $db = null | |
| $user_data = array() | |
| $usr_id = null | |
Class ilUserDefinedData.
Definition at line 34 of file class.ilUserDefinedData.php.
| ilUserDefinedData::__read | ( | ) |
Definition at line 113 of file class.ilUserDefinedData.php.
Referenced by ilUserDefinedData().
{
$this->user_data = array();
$query = "SELECT * FROM usr_defined_data ".
"WHERE usr_id = ".$this->db->quote($this->usr_id)."";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
foreach($row as $field => $data)
{
if($field != 'usr_id')
{
$this->user_data[$field] = $data;
}
}
}
}
Here is the caller graph for this function:| ilUserDefinedData::addToXML | ( | $ | xml_writer | ) |
add user defined field data to xml (using usr dtd)
| $xml_writer |
Definition at line 97 of file class.ilUserDefinedData.php.
References ilUserDefinedFields::_getInstance().
Referenced by toXML().
{
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$udf_obj =& ilUserDefinedFields::_getInstance();
foreach($udf_obj->getDefinitions() as $definition)
{
if ($definition["export"] != FALSE)
$xml_writer->xmlElement('UserDefinedField',
array('Id' => $definition['il_id'],
'Name' => $definition['field_name']),
$this->user_data["$definition[field_id]"]);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilUserDefinedData::get | ( | $ | a_field | ) |
Definition at line 59 of file class.ilUserDefinedData.php.
{
return isset($this->user_data[$a_field]) ? $this->user_data[$a_field] : '';
}
| ilUserDefinedData::getUserId | ( | ) |
Definition at line 50 of file class.ilUserDefinedData.php.
{
return $this->usr_id;
}
| ilUserDefinedData::ilUserDefinedData | ( | $ | a_usr_id | ) |
Definition at line 40 of file class.ilUserDefinedData.php.
References __read().
{
global $ilDB;
$this->db =& $ilDB;
$this->usr_id = $a_usr_id;
$this->__read();
}
Here is the call graph for this function:| ilUserDefinedData::set | ( | $ | a_field, | |
| $ | a_value | |||
| ) |
Definition at line 55 of file class.ilUserDefinedData.php.
{
$this->user_data[$a_field] = $a_value;
}
| ilUserDefinedData::toXML | ( | ) |
Definition at line 83 of file class.ilUserDefinedData.php.
References addToXML().
{
include_once 'classes/class.ilXmlWriter.php';
$xml_writer = new ilXmlWriter();
$this->addToXML ($xml_writer);
return $xml_writer->xmlDumpMem(false);
}
Here is the call graph for this function:| ilUserDefinedData::update | ( | ) |
Definition at line 64 of file class.ilUserDefinedData.php.
References ilUserDefinedFields::_getInstance().
{
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$udf_obj =& ilUserDefinedFields::_getInstance();
$sql = '';
foreach($udf_obj->getDefinitions() as $definition)
{
$sql .= ("`".(int) $definition['field_id']."` = ".$this->db->quote($this->get($definition['field_id'])).", ");
}
$query = "REPLACE INTO usr_defined_data ".
"SET ".$sql." ".
"usr_id = '".$this->getUserId()."'";
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilUserDefinedData::$db = null |
Definition at line 36 of file class.ilUserDefinedData.php.
| ilUserDefinedData::$user_data = array() |
Definition at line 37 of file class.ilUserDefinedData.php.
| ilUserDefinedData::$usr_id = null |
Definition at line 38 of file class.ilUserDefinedData.php.
1.7.1