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))
82 $query =
"SELECT * FROM crs_user_data ".
85 $res = $ilDB->query($query);
88 $user_data[$row->usr_id][$row->field_id] = $row->value;
91 return $user_data ? $user_data : array();
109 include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
111 if(!count($required))
117 $query =
"SELECT COUNT(*) as num_entries FROM crs_user_data ".
118 "WHERE usr_id = ".$ilDB->quote($a_usr_id).
" ".
121 $res = $ilDB->query($query);
124 return $row->num_entries == count($required);
139 $query =
"DELETE FROM crs_user_data ".
140 "WHERE usr_id = ".$ilDB->quote($a_user_id);
141 $ilDB->query($query);
156 $query =
"DELETE FROM crs_user_data ".
157 "WHERE field_id = ".$ilDB->quote($a_field_id);
158 $ilDB->query($query);
163 $this->value = $a_value;
188 public function delete()
190 $query =
"DELETE FROM crs_user_data ".
191 "WHERE usr_id = ".$this->db->quote($this->user_id).
" ".
192 "AND field_id = ".$this->db->quote($this->field_id);
193 $this->db->query($query);
204 $query =
"INSERT INTO crs_user_data SET ".
205 "value = ".$this->db->quote($this->
getValue()).
", ".
206 "usr_id = ".$this->db->quote($this->user_id).
", ".
207 "field_id = ".$this->db->quote($this->field_id).
" ";
208 $this->db->query($query);
218 $query =
"SELECT * FROM crs_user_data ".
219 "WHERE usr_id = ".$this->db->quote($this->user_id).
" ".
220 "AND field_id = ".$this->db->quote($this->field_id);
221 $res = $this->db->query($query);