4 require_once
'./Modules/DataCollection/exceptions/class.ilDclInputException.php';
91 $query =
"SELECT * FROM il_dcl_record_field WHERE field_id = " . $this->db->quote($this->
getField()->
getId(),
"integer") .
" AND record_id = " 93 $set = $this->db->query(
$query);
94 $rec = $this->db->fetchAssoc($set);
95 $this->
id = $rec[
'id'];
105 $id = $this->db->nextId(
"il_dcl_record_field");
106 $query =
"INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (" . $this->db->quote(
$id,
"integer") .
", " 108 $this->db->manipulate(
$query);
118 $datatype = $this->
getField()->getDatatype();
119 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null)? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
121 if($storage_location != 0) {
122 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 123 . $this->db->quote($this->
id,
"integer");
124 $this->db->manipulate(
$query);
126 $next_id = $this->db->nextId(
"il_dcl_stloc" . $storage_location .
"_value");
129 if ($storage_location == 3 && (is_null($this->value) || empty($this->value))) {
130 $this->value =
'0000-00-00 00:00:00';
135 if($this->
getId() == 0) {
139 $insert_params =
array(
141 "record_field_id" =>
array(
"integer", $this->
getId()),
142 "id" =>
array(
"integer", $next_id )
145 $this->db->insert(
"il_dcl_stloc" . $storage_location .
"_value", $insert_params);
153 public function delete() {
154 $datatype = $this->
getField()->getDatatype();
155 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null)? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
157 if($storage_location != 0) {
158 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 159 . $this->db->quote($this->
id,
"integer");
160 $this->db->manipulate(
$query);
163 $query2 =
"DELETE FROM il_dcl_record_field WHERE id = " . $this->db->quote($this->
id,
"integer");
164 $this->db->manipulate($query2);
206 $deserialize = json_decode(
$value,
true);
207 if(is_array($deserialize)) {
221 if (! $omit_parsing) {
225 if ($tmp !==
false) {
336 if ($this->value === NULL) {
337 $datatype = $this->
getField()->getDatatype();
339 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null)? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
340 if($storage_location != 0) {
341 $query =
"SELECT * FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 342 . $this->db->quote($this->
id,
"integer");
344 $set = $this->db->query(
$query);
345 $rec = $this->db->fetchAssoc($set);
parseValue($value)
Function to parse incoming data from form input value $value.
Class ilDclBaseFieldModel.
Class ilDclBaseFieldModel.
addHiddenItem($a_post_var, $a_value)
Add hidden item.
setFieldRepresentation($field_representation)
parseSortingValue($value, $link=true)
Returns sortable value for the specific field-types.
setValue($value, $omit_parsing=false)
Set value for record field.
getValueForRepresentation()
getValueFromExcel($excel, $row, $col)
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
doRead()
Read object data from database.
doCreate()
Creates an Id and a database entry.
cloneStructure(ilDclBaseRecordFieldModel $old_record_field)
deserializeData($value)
Deserialize data before applying to field.
parseExportValue($value)
Function to parse incoming data from form input value $value.
doUpdate()
Update object in database.
fillExcelExport(ilExcel $worksheet, &$row, &$col)
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
serializeData($value)
Serialize data before storing to db.
loadValue()
Load the value.
Create styles array
The data for the language used.
setCell($a_row, $a_col, $a_value)
Set cell value.
Class ilDclBaseRecordModel.
getRecordRepresentation()
setRecordRepresentation($record_representation)
Confirmation screen class.
getSortingValue($link=true)