53 $this->user_id = $a_user_id;
54 $this->field_id = $a_field_id;
74 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
76 if(!count($field_ids))
81 $where =
"WHERE ".$ilDB->in(
'field_id',$field_ids,
false,
'integer');
82 $query =
"SELECT * FROM crs_user_data ".
91 return $user_data ? $user_data :
array();
109 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
111 if(!count($required))
117 $and =
"AND ".$ilDB->in(
'field_id',$required,
false,
'integer');
119 $query =
"SELECT COUNT(*) num_entries FROM crs_user_data ".
120 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
121 "AND value != '' AND value IS NOT NULL ".
127 return $row->num_entries == count($required);
142 $query =
"DELETE FROM crs_user_data ".
143 "WHERE usr_id = ".$ilDB->quote($a_user_id ,
'integer');
159 $query =
"DELETE FROM crs_user_data ".
160 "WHERE field_id = ".$ilDB->quote($a_field_id ,
'integer');
166 $this->value = $a_value;
191 public function delete()
195 $query =
"DELETE FROM crs_user_data ".
196 "WHERE usr_id = ".$this->db->quote($this->user_id ,
'integer').
" ".
197 "AND field_id = ".$this->db->quote($this->field_id ,
'integer');
211 $query =
"INSERT INTO crs_user_data (value,usr_id,field_id) ".
213 $this->db->quote($this->
getValue() ,
'text').
", ".
214 $this->db->quote($this->user_id ,
'integer').
", ".
215 $this->db->quote($this->field_id ,
'integer').
" ".
230 $query =
"SELECT * FROM crs_user_data ".
231 "WHERE usr_id = ".$this->db->quote($this->user_id ,
'integer').
" ".
232 "AND field_id = ".$this->db->quote($this->field_id ,
'integer');
__construct($a_user_id, $a_field_id=0)
Contructor.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
static _getFieldIds($a_container_id, $a_sort=IL_CDF_SORT_ID)
Get all field ids of a container.
static _getRequiredFieldIds($a_obj_id)
Get required filed id's.
static _deleteByField($a_field_id)
Delete by field.
static _checkRequired($a_usr_id, $a_obj_id)
Check required fields.
Create styles array
The data for the language used.
static _deleteByUser($a_user_id)
Delete all entries of an user.