21 protected ?
int $id = null;
45 $this->
ctrl = $DIC->ctrl();
46 $this->
user = $DIC->user();
47 $this->db = $DIC->database();
48 $this->
lng = $DIC->language();
49 $this->
http = $DIC->http();
63 $query =
"SELECT * FROM il_dcl_record_field WHERE field_id = " . $this->db->quote(
66 ) .
" AND record_id = " 68 $set = $this->db->query(
$query);
69 $rec = $this->db->fetchAssoc($set);
70 $this->
id = $rec[
'id'] ?? null;
80 $id = $this->db->nextId(
"il_dcl_record_field");
81 $query =
"INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (" . $this->db->quote(
88 ) .
", " . $this->db->quote($this->
getField()->
getId(),
"text") .
")";
89 $this->db->manipulate(
$query);
99 $datatype = $this->
getField()->getDatatype();
100 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null) ? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
102 if ($storage_location != 0) {
103 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 104 . $this->db->quote($this->
id,
"integer");
105 $this->db->manipulate(
$query);
107 $next_id = $this->db->nextId(
"il_dcl_stloc" . $storage_location .
"_value");
111 if ($this->
getId() == 0) {
115 $insert_params = array(
116 "value" => array($datatype->getDbType(),
$value),
117 "record_field_id" => array(
"integer", $this->
getId()),
118 "id" => array(
"integer", $next_id),
121 $this->db->insert(
"il_dcl_stloc" . $storage_location .
"_value", $insert_params);
128 public function delete():
void 130 $datatype = $this->
getField()->getDatatype();
131 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null) ? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
133 if ($storage_location != 0) {
134 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 135 . $this->db->quote($this->
id,
"integer");
136 $this->db->manipulate(
$query);
139 $query2 =
"DELETE FROM il_dcl_record_field WHERE id = " . $this->db->quote($this->
id,
"integer");
140 $this->db->manipulate($query2);
182 $deserialize = json_decode(
$value,
true);
183 if (is_array($deserialize)) {
198 if (!$omit_parsing) {
202 if ($tmp !==
false) {
312 if ($this->value === null) {
313 $datatype = $this->
getField()->getDatatype();
315 $storage_location = ($this->
getField()->getStorageLocationOverride() !== null) ? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
316 if ($storage_location != 0) {
317 $query =
"SELECT * FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = " 318 . $this->db->quote($this->
id,
"integer");
320 $set = $this->db->query(
$query);
321 $rec = $this->db->fetchAssoc($set);
parseValue($value)
Function to parse incoming data from form input value $value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS HTTP Services $http
setValueFromForm(ilPropertyFormGUI $form)
ilDclBaseRecordRepresentation $record_representation
fillExcelExport(ilExcel $worksheet, int &$row, int &$col)
setValue($value, bool $omit_parsing=false)
Set value for record field.
getValueForRepresentation()
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
addHiddenItem(string $a_post_var, string $a_value)
doRead()
Read object data from database.
getValueFromExcel(ilExcel $excel, int $row, int $col)
doCreate()
Creates an Id and a database entry.
cloneStructure(ilDclBaseRecordFieldModel $old_record_field)
deserializeData($value)
Deserialize data before applying to field.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilDclBaseFieldRepresentation $field_representation
parseExportValue($value)
Function to parse incoming data from form input value $value.
setRecordRepresentation(ilDclBaseRecordRepresentation $record_representation)
static http()
Fetches the global http state from ILIAS.
addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation)
doUpdate()
Update object in database.
setFieldRepresentation(ilDclBaseFieldRepresentation $field_representation)
parseSortingValue($value, bool $link=true)
Returns sortable value for the specific field-types.
serializeData($value)
Serialize data before storing to db.
getCell(int $a_row, int $a_col)
Returns the value of a cell.
loadValue()
Load the value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Refinery Factory $refinery
ilDclBaseFieldModel $field
getRecordRepresentation()
getSortingValue(bool $link=true)
ilDclBaseRecordModel $record
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...