4require_once
'./Modules/DataCollection/exceptions/class.ilDclInputException.php';
95 $query =
"SELECT * FROM il_dcl_record_field WHERE field_id = " . $this->db->quote($this->
getField()->
getId(),
"integer") .
" AND record_id = "
97 $set = $this->db->query(
$query);
98 $rec = $this->db->fetchAssoc($set);
99 $this->
id = $rec[
'id'];
110 $id = $this->db->nextId(
"il_dcl_record_field");
111 $query =
"INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (" . $this->db->quote(
$id,
"integer") .
", "
113 $this->db->manipulate(
$query);
124 $datatype = $this->
getField()->getDatatype();
125 $storage_location = ($this->
getField()->getStorageLocationOverride() !==
null)? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
127 if ($storage_location != 0) {
128 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = "
129 . $this->db->quote($this->
id,
"integer");
130 $this->db->manipulate(
$query);
132 $next_id = $this->db->nextId(
"il_dcl_stloc" . $storage_location .
"_value");
135 if ($storage_location == 3 && (is_null($this->value) || empty($this->value))) {
136 $this->value =
'0000-00-00 00:00:00';
141 if ($this->
getId() == 0) {
145 $insert_params = array(
146 "value" => array( $datatype->getDbType(),
$value),
147 "record_field_id" => array(
"integer", $this->
getId()),
148 "id" => array(
"integer", $next_id )
151 $this->db->insert(
"il_dcl_stloc" . $storage_location .
"_value", $insert_params);
159 public function delete()
161 $datatype = $this->
getField()->getDatatype();
162 $storage_location = ($this->
getField()->getStorageLocationOverride() !==
null)? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
164 if ($storage_location != 0) {
165 $query =
"DELETE FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = "
166 . $this->db->quote($this->
id,
"integer");
167 $this->db->manipulate(
$query);
170 $query2 =
"DELETE FROM il_dcl_record_field WHERE id = " . $this->db->quote($this->
id,
"integer");
171 $this->db->manipulate($query2);
217 $deserialize = json_decode(
$value,
true);
218 if (is_array($deserialize)) {
233 if (!$omit_parsing) {
237 if ($tmp !==
false) {
333 $confirmation->
addHiddenItem(
'field_' . $this->field->getId(), $this->getValue());
360 if ($this->value ===
null) {
361 $datatype = $this->
getField()->getDatatype();
363 $storage_location = ($this->
getField()->getStorageLocationOverride() !==
null)? $this->
getField()->getStorageLocationOverride() : $datatype->getStorageLocation();
364 if ($storage_location != 0) {
365 $query =
"SELECT * FROM il_dcl_stloc" . $storage_location .
"_value WHERE record_field_id = "
366 . $this->db->quote($this->
id,
"integer");
368 $set = $this->db->query(
$query);
369 $rec = $this->db->fetchAssoc($set);
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
addHiddenItem($a_post_var, $a_value)
Add hidden item.
Class ilDclBaseFieldModel.
Class ilDclBaseFieldModel.
addHiddenItemsToConfirmation(ilConfirmationGUI &$confirmation)
getSortingValue($link=true)
getValueFromExcel($excel, $row, $col)
getRecordRepresentation()
setRecordRepresentation($record_representation)
deserializeData($value)
Deserialize data before applying to field.
parseValue($value)
Function to parse incoming data from form input value $value.
parseExportValue($value)
Function to parse incoming data from form input value $value.
fillExcelExport(ilExcel $worksheet, &$row, &$col)
parseSortingValue($value, $link=true)
Returns sortable value for the specific field-types.
doCreate()
Creates an Id and a database entry.
doUpdate()
Update object in database.
serializeData($value)
Serialize data before storing to db.
setValue($value, $omit_parsing=false)
Set value for record field.
getValueForRepresentation()
doRead()
Read object data from database.
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)
setFieldRepresentation($field_representation)
cloneStructure(ilDclBaseRecordFieldModel $old_record_field)
loadValue()
Load the value.
Class ilDclBaseRecordModel.
if(isset($_POST['submit'])) $form