ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilUserDefinedData Class Reference

Class ilUserDefinedData. More...

+ Collaboration diagram for ilUserDefinedData:

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

Detailed Description

Class ilUserDefinedData.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilUserDefinedData.php 15697 2008-01-08 20:04:33Z hschottm

Definition at line 34 of file class.ilUserDefinedData.php.

Member Function Documentation

ilUserDefinedData::__read ( )

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

References $data, $res, and DB_FETCHMODE_ASSOC.

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)

Parameters
$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';
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.

References $usr_id.

{
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.

Referenced by ilUserImportParser\importEndTag().

{
$this->user_data[$a_field] = $a_value;
}

+ Here is the caller graph for this function:

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';
$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:

Field Documentation

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.

Referenced by getUserId().


The documentation for this class was generated from the following file: