4 require_once
'./Modules/DataCollection/exceptions/class.ilDataCollectionInputException.php';
74 if(!$this->record->getId())
77 $query =
"SELECT * FROM il_dcl_record_field WHERE field_id = " . $this->db->quote($this->field->getId(),
"integer") .
" AND record_id = " 78 . $this->db->quote($this->record->getId(),
"integer");
79 $set = $this->db->query(
$query);
80 $rec = $this->db->fetchAssoc($set);
81 $this->
id = $rec[
'id'];
83 if ($this->
id == null) {
95 $id = $this->db->nextId(
"il_dcl_record_field");
96 $query =
"INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (" . $this->db->quote(
$id,
"integer") .
", " 97 . $this->db->quote($this->record->getId(),
"integer") .
", " . $this->db->quote($this->field->getId(),
"text") .
")";
98 $this->db->manipulate(
$query);
111 $datatype = $this->field->getDatatype();
112 $query =
"DELETE FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value WHERE record_field_id = " 113 . $this->db->quote($this->
id,
"integer");
114 $this->db->manipulate(
$query);
115 $next_id = $this->db->nextId(
"il_dcl_stloc" . $datatype->getStorageLocation() .
"_value");
118 if ($datatype->getStorageLocation() == 3 && (is_null($this->value) || empty($this->value))) {
119 $this->value =
'0000-00-00 00:00:00';
122 $this->db->insert(
"il_dcl_stloc" . $datatype->getStorageLocation() .
"_value", array(
123 "value" => array( $datatype->getDbType(),
$this->value ),
124 "record_field_id " => array(
"integer", $this->
id ),
125 "id" => array(
"integer", $next_id )
133 public function delete() {
134 $datatype = $this->field->getDatatype();
135 $query =
"DELETE FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value WHERE record_field_id = " 136 . $this->db->quote($this->
id,
"integer");
137 $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);
162 if (! $omit_parsing) {
163 $tmp = $this->field->getDatatype()->parseValue(
$value, $this);
166 if ($tmp !==
false) {
184 && $form->getItemByPostVar(
"field_" . $this->field->getId())->getDeletionFlag()
188 $value = $form->getInput(
"field_" . $this->field->getId());
203 'date' => date(
'Y-m-d', strtotime(
$value)),
204 'time' =>
'00:00:00',
215 $form->getItemByPostVar(
'field_'.$this->field->getId())->setValueByArray(array(
"field_".$this->field->getId() =>
$value));
223 $datatype = $this->field->getDatatype();
225 return $datatype->parseFormInput($this->
getValue(), $this);
233 $datatype = $this->field->getDatatype();
235 return $datatype->parseExportValue($this->
getValue());
261 $datatype = $this->field->getDatatype();
263 return $datatype->parseHTML($this->
getValue(), $this, $link);
270 $datatype = $this->field->getDatatype();
272 return $datatype->parseSortingValue($this->
getValue(), $this, $link);
288 if ($this->value === NULL) {
289 $datatype = $this->field->getDatatype();
290 switch ($datatype->getId()) {
294 $query =
"SELECT * FROM il_dcl_stloc" . $datatype->getStorageLocation() .
"_value WHERE record_field_id = " 295 . $this->db->quote($this->
id,
"integer");
297 $set = $this->db->query(
$query);
298 $rec = $this->db->fetchAssoc($set);
299 $this->value = $rec[
'value'];
const INPUTFORMAT_DATETIME
fillExcelExport($worksheet, &$row, &$col)
loadValue()
Load the value.
getSortingValue($link=true)
doCreate()
Creates an Id and a database entry.
doRead()
Read object data from database.
Class ilDataCollectionRecord.
doUpdate()
Update object in database.
__construct(ilDataCollectionRecord $record, ilDataCollectionField $field)
setValue($value, $omit_parsing=false)
Set value for record field.
Class ilDataCollectionField.
Class ilDataCollectionField.
getValueFromExcel($excel, $row, $col)