4 require_once
'./Modules/DataCollection/exceptions/class.ilDclInputException.php';
93 $query =
"SELECT * FROM il_dcl_record_field WHERE field_id = " . $this->db->quote($this->
getField()->
getId(),
"integer") .
" AND record_id = " 95 $set = $this->db->query(
$query);
96 $rec = $this->db->fetchAssoc($set);
97 $this->
id = $rec[
'id'];
108 $id = $this->db->nextId(
"il_dcl_record_field");
109 $query =
"INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (" . $this->db->quote(
$id,
"integer") .
", " 111 $this->db->manipulate(
$query);
122 $datatype = $this->
getField()->getDatatype();
123 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null) ? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
125 if ($storage_location != 0) {
126 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 127 . $this->db->quote($this->
id,
"integer");
128 $this->db->manipulate(
$query);
130 $next_id = $this->db->nextId(
"il_dcl_stloc" . $storage_location .
"_value");
133 if ($storage_location == 3 && (is_null($this->value) || empty($this->value))) {
134 $this->value =
'0000-00-00 00:00:00';
139 if ($this->
getId() == 0) {
143 $insert_params = array(
144 "value" => array($datatype->getDbType(),
$value),
145 "record_field_id" => array(
"integer", $this->
getId()),
146 "id" => array(
"integer", $next_id),
149 $this->db->insert(
"il_dcl_stloc" . $storage_location .
"_value", $insert_params);
157 public function delete()
159 $datatype = $this->
getField()->getDatatype();
160 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null) ? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
162 if ($storage_location != 0) {
163 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 164 . $this->db->quote($this->
id,
"integer");
165 $this->db->manipulate(
$query);
168 $query2 =
"DELETE FROM il_dcl_record_field WHERE id = " . $this->db->quote($this->
id,
"integer");
169 $this->db->manipulate($query2);
219 $deserialize = json_decode(
$value,
true);
220 if (is_array($deserialize)) {
237 if (!$omit_parsing) {
241 if ($tmp !==
false) {
383 if ($this->value === null) {
384 $datatype = $this->
getField()->getDatatype();
386 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null) ? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
387 if ($storage_location != 0) {
388 $query =
"SELECT * FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 389 . $this->db->quote($this->
id,
"integer");
391 $set = $this->db->query(
$query);
392 $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.
if(isset($_POST['submit'])) $form
doUpdate()
Update object in database.
fillExcelExport(ilExcel $worksheet, &$row, &$col)
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
serializeData($value)
Serialize data before storing to db.
loadValue()
Load the value.
Class ilDclBaseRecordModel.
getRecordRepresentation()
setRecordRepresentation($record_representation)
Confirmation screen class.
getSortingValue($link=true)