ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilDclBaseFieldModel Class Reference

Class ilDclBaseFieldModel. More...

+ Inheritance diagram for ilDclBaseFieldModel:
+ Collaboration diagram for ilDclBaseFieldModel:

Public Member Functions

 __construct ($a_id=0)
 
 setId ($a_id)
 Set field id. More...
 
 getId ()
 Get field id. More...
 
 setTableId ($a_id)
 Set table id. More...
 
 getTableId ()
 Get table id. More...
 
 setTitle ($a_title)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setDescription ($a_desc)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setDatatypeId ($a_id)
 Set datatype id. More...
 
 getDatatypeId ()
 Get datatype_id. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required Required. More...
 
 isUnique ()
 
 setUnique ($unique)
 
 getDatatype ()
 
 getDatatypeTitle ()
 
 getStorageLocation ()
 Get storage location for the model. More...
 
 getExportable ()
 
 toArray ()
 
 isStandardField ()
 
 doRead ()
 Read field. More...
 
 buildFromDBRecord ($rec)
 Builds model from db record. More...
 
 doCreate ()
 Create new field. More...
 
 doUpdate ()
 Update field. More...
 
 updateProperties ()
 Update properties of this field in Database. More...
 
 doDelete ()
 Remove field and properties. More...
 
 getFieldSettings ()
 
 getOrder ()
 
 setOrder ($order)
 
 hasProperty ($key)
 Checks if a certain property for a field is set. More...
 
 getProperty ($key)
 Returns a certain property of a field. More...
 
 getPropertyInstance ($key)
 Return ActiveRecord of property. More...
 
 setProperty ($key, $value)
 Set a property for a field (does not save) More...
 
 getValidFieldProperties ()
 Returns all valid properties for a field-type. More...
 
 setLocked ($locked)
 
 getLocked ()
 
 checkValidityFromForm (ilPropertyFormGUI &$form, $record_id=null)
 
 checkValidity ($value, $record_id=null)
 Check if input is valid. More...
 
 cloneStructure ($original_id)
 
 afterClone ($records)
 
 cloneProperties (ilDclBaseFieldModel $originalField)
 
 setExportable ($exportable)
 
 allowFilterInListView ()
 
 getRecordQuerySortObject ($direction="asc", $sort_by_status=false)
 Returns a query-object for building the record-loader-sql-query. More...
 
 getRecordQueryFilterObject ($filter_value="", ilDclBaseFieldModel $sort_field=null)
 Returns a query-object for building the record-loader-sql-query. More...
 
 getSortField ()
 Returns the sort-field id. More...
 
 hasNumericSorting ()
 Set to true, when the sorting should be handled numerical. More...
 
 checkFieldCreationInput (ilPropertyFormGUI $form)
 Checks input of specific fields befor saving. More...
 
 getStorageLocationOverride ()
 
 setStorageLocationOverride ($storage_location_override)
 
 fillHeaderExcel (ilExcel $worksheet, &$row, &$col)
 
 checkTitlesForImport (array &$titles, array &$import_fields)
 
 storePropertiesFromForm (ilPropertyFormGUI $form)
 called when saving the 'edit field' form More...
 
 fillPropertiesForm (ilPropertyFormGUI &$form)
 called to fill the 'edit field' form More...
 
 isConfirmationRequired (ilPropertyFormGUI $form)
 called by ilDclFieldEditGUI when updating field properties if you overwrite this method, remember to also overwrite getConfirmationGUI More...
 
 getConfirmationGUI (ilPropertyFormGUI $form)
 called by ilDclFieldEditGUI if isConfirmationRequired returns true More...
 

Static Public Member Functions

static _getTitleInvalidChars ($a_as_regex=true)
 All valid chars for filed titles. More...
 
static _getFieldIdByTitle ($title, $table_id)
 

Data Fields

const PROP_LENGTH = "lenght"
 General properties. More...
 
const PROP_REGEX = "regex"
 
const PROP_REFERENCE = "table_id"
 
const PROP_URL = "url"
 
const PROP_TEXTAREA = "text_area"
 
const PROP_REFERENCE_LINK = "reference_link"
 
const PROP_WIDTH = "width"
 
const PROP_HEIGHT = "height"
 
const PROP_LEARNING_PROGRESS = "learning_progress"
 
const PROP_ILIAS_REFERENCE_LINK = "ILIAS_reference_link"
 
const PROP_N_REFERENCE = "multiple_selection"
 
const PROP_FORMULA_EXPRESSION = "expression"
 
const PROP_DISPLAY_COPY_LINK_ACTION_MENU = "display_action_menu"
 
const PROP_LINK_DETAIL_PAGE_TEXT = "link_detail_page"
 
const PROP_SUPPORTED_FILE_TYPES = "supported_file_types"
 
const PROP_PLUGIN_HOOK_NAME = "plugin_hook_name"
 
const PROP_TEXT_SELECTION_OPTIONS = "text_selection_options"
 
const PROP_TEXT_SELECTION_TYPE = "text_selection_type"
 
const PROP_DATE_SELECTION_OPTIONS = "date_selection_options"
 
const PROP_DATE_SELECTION_TYPE = "date_selection_type"
 
const EDIT_VIEW = 2
 
const EXPORTABLE_VIEW = 4
 

Protected Member Functions

 loadDatatype ()
 Load datatype for model. More...
 
 loadTableFieldSetting ()
 loadTableFieldSetting More...
 
 addToTableViews ()
 create ilDclTableViewFieldSettings for this field in each tableview More...
 
 updateTableFieldSetting ()
 update exportable and fieldorder More...
 
 loadProperties ()
 Get all properties of a field. More...
 
 normalizeValue ($value)
 

Protected Attributes

 $id
 
 $table_id
 
 $title
 
 $description
 
 $datatypeId
 
 $required
 
 $order
 
 $unique
 
 $locked
 
 $property = array()
 
 $exportable
 
 $datatype
 
 $storage_location_override = null
 

Private Member Functions

 loadExportability ()
 Load exportability. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDclBaseFieldModel::__construct (   $a_id = 0)
Parameters
int$a_id

Definition at line 101 of file class.ilDclBaseFieldModel.php.

References doRead().

102  {
103  if ($a_id != 0) {
104  $this->id = $a_id;
105  $this->doRead();
106  }
107  }
+ Here is the call graph for this function:

Member Function Documentation

◆ _getFieldIdByTitle()

static ilDclBaseFieldModel::_getFieldIdByTitle (   $title,
  $table_id 
)
static
Parameters
$titleTitle of the field
$table_idID of table where the field belongs to
Returns
int

Definition at line 133 of file class.ilDclBaseFieldModel.php.

References $DIC, $id, $ilDB, $result, $table_id, and $title.

134  {
135  global $DIC;
136  $ilDB = $DIC['ilDB'];
137  $result = $ilDB->query(
138  'SELECT id FROM il_dcl_field WHERE title = ' . $ilDB->quote($title, 'text') . ' AND table_id = '
139  . $ilDB->quote($table_id, 'integer')
140  );
141  $id = 0;
142  while ($rec = $ilDB->fetchAssoc($result)) {
143  $id = $rec['id'];
144  }
145 
146  return $id;
147  }
$result
global $DIC
Definition: saml.php:7
global $ilDB

◆ _getTitleInvalidChars()

static ilDclBaseFieldModel::_getTitleInvalidChars (   $a_as_regex = true)
static

All valid chars for filed titles.

Parameters
bool$a_as_regex
Returns
string

Definition at line 117 of file class.ilDclBaseFieldModel.php.

Referenced by ilDclFieldEditGUI\initForm().

118  {
119  if ($a_as_regex) {
120  return '/^[^<>\\\\":]*$/i';
121  } else {
122  return '\ < > " :';
123  }
124  }
+ Here is the caller graph for this function:

◆ addToTableViews()

ilDclBaseFieldModel::addToTableViews ( )
protected

create ilDclTableViewFieldSettings for this field in each tableview

Definition at line 487 of file class.ilDclBaseFieldModel.php.

References ilDclTableView\getAllForTableId().

Referenced by doCreate().

488  {
489  foreach (ilDclTableView::getAllForTableId($this->table_id) as $tableview) {
490  $tableview->createFieldSetting($this->id);
491  }
492  }
static getAllForTableId($table_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterClone()

ilDclBaseFieldModel::afterClone (   $records)
Parameters
$records

Definition at line 818 of file class.ilDclBaseFieldModel.php.

References $records, and ilDclCache\getRecordFieldCache().

Referenced by ilDclReferenceFieldModel\getFieldRef().

819  {
820  foreach ($records as $rec) {
821  ilDclCache::getRecordFieldCache($rec, $this)->afterClone();
822  }
823  }
$records
Definition: simple_test.php:22
static getRecordFieldCache($record, $field)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allowFilterInListView()

ilDclBaseFieldModel::allowFilterInListView ( )
Returns
bool

Definition at line 865 of file class.ilDclBaseFieldModel.php.

866  {
867  return true;
868  }

◆ buildFromDBRecord()

ilDclBaseFieldModel::buildFromDBRecord (   $rec)

Builds model from db record.

Parameters
$rec

Definition at line 443 of file class.ilDclBaseFieldModel.php.

References setDatatypeId(), setDescription(), setId(), setLocked(), setRequired(), setTableId(), setTitle(), and setUnique().

444  {
445  $this->setId($rec["id"]);
446  $this->setTableId($rec["table_id"]);
447  $this->setTitle($rec["title"]);
448  $this->setDescription($rec["description"]);
449  $this->setDatatypeId($rec["datatype_id"]);
450  $this->setRequired($rec["required"]);
451  $this->setUnique($rec["is_unique"]);
452  $this->setLocked($rec["is_locked"]);
453  }
setDescription($a_desc)
Set description.
setDatatypeId($a_id)
Set datatype id.
setTableId($a_id)
Set table id.
setRequired($a_required)
Set Required.
setTitle($a_title)
Set title.
+ Here is the call graph for this function:

◆ checkFieldCreationInput()

ilDclBaseFieldModel::checkFieldCreationInput ( ilPropertyFormGUI  $form)

Checks input of specific fields befor saving.

Parameters
ilPropertyFormGUI$form
Returns
boolean if checkInput was successful

Definition at line 947 of file class.ilDclBaseFieldModel.php.

948  {
949  return true;
950  }

◆ checkTitlesForImport()

ilDclBaseFieldModel::checkTitlesForImport ( array &  $titles,
array &  $import_fields 
)
Parameters
array$titles
array$import_fields

Definition at line 987 of file class.ilDclBaseFieldModel.php.

References $title, getTitle(), and ilStr\isUtf8().

988  {
989  foreach ($titles as $k => $title) {
990  if (!ilStr::isUtf8($title)) {
991  $title = utf8_encode($title);
992  }
993  if ($title == $this->getTitle()) {
994  $import_fields[$k] = $this;
995  }
996  }
997  }
static isUtf8($a_str)
Check whether string is utf-8.
+ Here is the call graph for this function:

◆ checkValidity()

ilDclBaseFieldModel::checkValidity (   $value,
  $record_id = null 
)

Check if input is valid.

Parameters
$value
null$record_id
Returns
bool
Exceptions
ilDclInputException

Definition at line 756 of file class.ilDclBaseFieldModel.php.

References $table, ilDclCache\getTableCache(), getTableId(), isUnique(), normalizeValue(), and ilDclInputException\UNIQUE_EXCEPTION.

Referenced by checkValidityFromForm().

757  {
758  //Don't check empty values
759  if ($value == null) {
760  return true;
761  }
762 
763  if ($this->isUnique()) {
765  foreach ($table->getRecords() as $record) {
766  if ($this->normalizeValue($record->getRecordFieldValue($this->getId())) == $this->normalizeValue($value) && ($record->getId() != $record_id || $record_id == 0)) {
768  }
769  }
770  }
771 
772  return true;
773  }
Class ilDclBaseFieldModel.
static getTableCache($table_id=0)
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkValidityFromForm()

ilDclBaseFieldModel::checkValidityFromForm ( ilPropertyFormGUI $form,
  $record_id = null 
)
Parameters
ilPropertyFormGUI$form
null$record_id

Definition at line 740 of file class.ilDclBaseFieldModel.php.

References checkValidity(), getId(), and ilPropertyFormGUI\getInput().

741  {
742  $value = $form->getInput('field_' . $this->getId());
743  $this->checkValidity($value, $record_id);
744  }
checkValidity($value, $record_id=null)
Check if input is valid.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ cloneProperties()

ilDclBaseFieldModel::cloneProperties ( ilDclBaseFieldModel  $originalField)
Parameters
ilDclBaseFieldModel$originalField

Definition at line 829 of file class.ilDclBaseFieldModel.php.

References getDatatypeId(), getId(), getProperty(), getValidFieldProperties(), ilDclDatatype\INPUTFORMAT_REFERENCE, and PROP_REFERENCE.

Referenced by cloneStructure().

830  {
831  $orgProps = $originalField->getValidFieldProperties();
832  if (count($orgProps) == 0) {
833  return;
834  }
835  foreach ($orgProps as $prop_name) {
836  $fieldprop_obj = new ilDclFieldProperty();
837  $fieldprop_obj->setFieldId($this->getId());
838  $fieldprop_obj->setName($prop_name);
839 
840  $value = $originalField->getProperty($prop_name);
841 
842  // If reference field, we must reset the referenced field, otherwise it will point to the old ID
844  $value = null;
845  }
846 
847  $fieldprop_obj->setValue($value);
848  $fieldprop_obj->create();
849  }
850  }
Class ilDclFieldProperty.
getProperty($key)
Returns a certain property of a field.
getValidFieldProperties()
Returns all valid properties for a field-type.
getDatatypeId()
Get datatype_id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneStructure()

ilDclBaseFieldModel::cloneStructure (   $original_id)
Parameters
$original_id
Exceptions
ilException

Definition at line 796 of file class.ilDclBaseFieldModel.php.

References cloneProperties(), doCreate(), ilDclCache\getFieldCache(), getId(), ilDclCache\setCloneOf(), setDatatypeId(), setDescription(), setExportable(), setLocked(), setOrder(), setRequired(), setTitle(), setUnique(), and ilDclCache\TYPE_FIELD.

797  {
798  $original = ilDclCache::getFieldCache($original_id);
799  $this->setTitle($original->getTitle());
800  $this->setDatatypeId($original->getDatatypeId());
801  $this->setDescription($original->getDescription());
802  $this->setLocked($original->getLocked());
803  $this->setOrder($original->getOrder());
804  $this->setRequired($original->getRequired());
805  $this->setUnique($original->isUnique());
806  $this->setExportable($original->getExportable());
807  $this->doCreate();
808  $this->cloneProperties($original);
809 
810  // mandatory for all cloning functions
811  ilDclCache::setCloneOf($original_id, $this->getId(), ilDclCache::TYPE_FIELD);
812  }
static setCloneOf($old, $new, $type)
setDescription($a_desc)
Set description.
setDatatypeId($a_id)
Set datatype id.
static getFieldCache($field_id=0)
setRequired($a_required)
Set Required.
cloneProperties(ilDclBaseFieldModel $originalField)
setTitle($a_title)
Set title.
+ Here is the call graph for this function:

◆ doCreate()

ilDclBaseFieldModel::doCreate ( )

Create new field.

Definition at line 459 of file class.ilDclBaseFieldModel.php.

References $DIC, $id, $ilDB, $query, ilDclTable\_tableExists(), addToTableViews(), getDatatypeId(), getDescription(), getId(), getLocked(), getRequired(), getTableId(), getTitle(), isUnique(), setId(), setLocked(), and updateTableFieldSetting().

Referenced by cloneStructure().

460  {
461  global $DIC;
462  $ilDB = $DIC['ilDB'];
463  $this->getLocked() == null ? $this->setLocked(false) : true;
464 
465  if (!ilDclTable::_tableExists($this->getTableId())) {
466  throw new ilException("The field does not have a related table!");
467  }
468 
469  $id = $ilDB->nextId("il_dcl_field");
470  $this->setId($id);
471  $query = "INSERT INTO il_dcl_field (" . "id" . ", table_id" . ", datatype_id" . ", title" . ", description" . ", required" . ", is_unique"
472  . ", is_locked" . " ) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getTableId(), "integer") . ","
473  . $ilDB->quote($this->getDatatypeId(), "integer") . "," . $ilDB->quote($this->getTitle(), "text") . ","
474  . $ilDB->quote($this->getDescription(), "text") . "," . $ilDB->quote($this->getRequired(), "integer") . ","
475  . $ilDB->quote($this->isUnique(), "integer") . "," . $ilDB->quote($this->getLocked() ? 1 : 0, "integer") . ")";
476  $ilDB->manipulate($query);
477 
478  $this->updateTableFieldSetting();
479 
480  $this->addToTableViews();
481  }
global $DIC
Definition: saml.php:7
addToTableViews()
create ilDclTableViewFieldSettings for this field in each tableview
static _tableExists($table_id)
getRequired()
Get Required Required.
$query
getDescription()
Get description.
updateTableFieldSetting()
update exportable and fieldorder
global $ilDB
getDatatypeId()
Get datatype_id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doDelete()

ilDclBaseFieldModel::doDelete ( )

Remove field and properties.

Definition at line 574 of file class.ilDclBaseFieldModel.php.

References $DIC, $ilDB, $query, getFieldSettings(), getId(), ilDclTableFieldSetting\getInstance(), and getTableId().

575  {
576  global $DIC;
577  $ilDB = $DIC['ilDB'];
578 
579  // delete tablefield setting.
580  ilDclTableFieldSetting::getInstance($this->getTableId(), $this->getId())->delete();
581 
582  $query = "DELETE FROM il_dcl_field_prop WHERE field_id = " . $ilDB->quote($this->getId(), "text");
583  $ilDB->manipulate($query);
584 
585  $query = "DELETE FROM il_dcl_field WHERE id = " . $ilDB->quote($this->getId(), "text");
586  $ilDB->manipulate($query);
587 
588  foreach ($this->getFieldSettings() as $field_setting) {
589  $field_setting->delete();
590  }
591  }
static getInstance($table_id, $field)
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the call graph for this function:

◆ doRead()

ilDclBaseFieldModel::doRead ( )

Read field.

Definition at line 416 of file class.ilDclBaseFieldModel.php.

References $DIC, $ilDB, $query, getId(), loadProperties(), loadTableFieldSetting(), setDatatypeId(), setDescription(), setLocked(), setRequired(), setTableId(), setTitle(), and setUnique().

Referenced by __construct().

417  {
418  global $DIC;
419  $ilDB = $DIC['ilDB'];
420 
421  //THEN 1 ELSE 0 END AS has_options FROM il_dcl_field f WHERE id = ".$ilDB->quote($this->getId(),"integer");
422  $query = "SELECT * FROM il_dcl_field WHERE id = " . $ilDB->quote($this->getId(), "integer");
423  $set = $ilDB->query($query);
424  $rec = $ilDB->fetchAssoc($set);
425 
426  $this->setTableId($rec["table_id"]);
427  $this->setTitle($rec["title"]);
428  $this->setDescription($rec["description"]);
429  $this->setDatatypeId($rec["datatype_id"]);
430  $this->setRequired($rec["required"]);
431  $this->setUnique($rec["is_unique"]);
432  $this->setLocked($rec["is_locked"]);
433  $this->loadProperties();
434  $this->loadTableFieldSetting();
435  }
setDescription($a_desc)
Set description.
setDatatypeId($a_id)
Set datatype id.
global $DIC
Definition: saml.php:7
loadTableFieldSetting()
loadTableFieldSetting
setTableId($a_id)
Set table id.
loadProperties()
Get all properties of a field.
setRequired($a_required)
Set Required.
$query
global $ilDB
setTitle($a_title)
Set title.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doUpdate()

ilDclBaseFieldModel::doUpdate ( )

Update field.

Definition at line 498 of file class.ilDclBaseFieldModel.php.

References $DIC, $ilDB, getDatatypeId(), getDescription(), getId(), getLocked(), getRequired(), getTableId(), getTitle(), isUnique(), updateProperties(), and updateTableFieldSetting().

499  {
500  global $DIC;
501  $ilDB = $DIC['ilDB'];
502 
503  $ilDB->update(
504  "il_dcl_field",
505  array(
506  "table_id" => array(
507  "integer",
508  $this->getTableId(),
509  ),
510  "datatype_id" => array(
511  "text",
512  $this->getDatatypeId(),
513  ),
514  "title" => array(
515  "text",
516  $this->getTitle(),
517  ),
518  "description" => array(
519  "text",
520  $this->getDescription(),
521  ),
522  "required" => array(
523  "integer",
524  $this->getRequired(),
525  ),
526  "is_unique" => array(
527  "integer",
528  $this->isUnique(),
529  ),
530  "is_locked" => array(
531  "integer",
532  $this->getLocked() ? 1 : 0,
533  ),
534  ),
535  array(
536  "id" => array(
537  "integer",
538  $this->getId(),
539  ),
540  )
541  );
542  $this->updateTableFieldSetting();
543  $this->updateProperties();
544  }
global $DIC
Definition: saml.php:7
updateProperties()
Update properties of this field in Database.
getRequired()
Get Required Required.
getDescription()
Get description.
updateTableFieldSetting()
update exportable and fieldorder
global $ilDB
getDatatypeId()
Get datatype_id.
+ Here is the call graph for this function:

◆ fillHeaderExcel()

ilDclBaseFieldModel::fillHeaderExcel ( ilExcel  $worksheet,
$row,
$col 
)
Parameters
ilExcel$worksheet
$row
$col

Definition at line 976 of file class.ilDclBaseFieldModel.php.

References $row, getTitle(), and ilExcel\setCell().

977  {
978  $worksheet->setCell($row, $col, $this->getTitle());
979  $col++;
980  }
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
$row
+ Here is the call graph for this function:

◆ fillPropertiesForm()

ilDclBaseFieldModel::fillPropertiesForm ( ilPropertyFormGUI $form)

called to fill the 'edit field' form

Parameters
ilPropertyFormGUI$form
Returns
bool

Definition at line 1027 of file class.ilDclBaseFieldModel.php.

References $values, getDatatypeId(), getDescription(), getId(), getProperty(), getRequired(), getTableId(), getTitle(), getValidFieldProperties(), isUnique(), and ilPropertyFormGUI\setValuesByArray().

1028  {
1029  $values = array(
1030  'table_id' => $this->getTableId(),
1031  'field_id' => $this->getId(),
1032  'title' => $this->getTitle(),
1033  'datatype' => $this->getDatatypeId(),
1034  'description' => $this->getDescription(),
1035  'required' => $this->getRequired(),
1036  'unique' => $this->isUnique(),
1037  );
1038 
1039  $properties = $this->getValidFieldProperties();
1040  foreach ($properties as $prop) {
1041  $values['prop_' . $prop] = $this->getProperty($prop);
1042  }
1043 
1044  $form->setValuesByArray($values);
1045 
1046  return true;
1047  }
$values
getRequired()
Get Required Required.
getDescription()
Get description.
getProperty($key)
Returns a certain property of a field.
getValidFieldProperties()
Returns all valid properties for a field-type.
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
getDatatypeId()
Get datatype_id.
+ Here is the call graph for this function:

◆ getConfirmationGUI()

ilDclBaseFieldModel::getConfirmationGUI ( ilPropertyFormGUI  $form)

called by ilDclFieldEditGUI if isConfirmationRequired returns true

Parameters
ilPropertyFormGUI$form
Returns
ilConfirmationGUI

Definition at line 1071 of file class.ilDclBaseFieldModel.php.

References $DIC, ilFormGUI\getFormAction(), and ilPropertyFormGUI\getInput().

1072  {
1073  global $DIC;
1074  $ilConfirmationGUI = new ilConfirmationGUI();
1075  $ilConfirmationGUI->setFormAction($form->getFormAction());
1076  $ilConfirmationGUI->addHiddenItem('confirmed', 1);
1077  $ilConfirmationGUI->addHiddenItem('field_id', $form->getInput('field_id'));
1078  $ilConfirmationGUI->addHiddenItem('title', $form->getInput('title'));
1079  $ilConfirmationGUI->addHiddenItem('description', $form->getInput('description'));
1080  $ilConfirmationGUI->addHiddenItem('datatype', $form->getInput('datatype'));
1081  $ilConfirmationGUI->addHiddenItem('required', $form->getInput('required'));
1082  $ilConfirmationGUI->addHiddenItem('unique', $form->getInput('unique'));
1083  $ilConfirmationGUI->setConfirm($DIC->language()->txt('dcl_update_field'), 'update');
1084  $ilConfirmationGUI->setCancel($DIC->language()->txt('cancel'), 'edit');
1085 
1086  return $ilConfirmationGUI;
1087  }
getFormAction()
Get FormAction.
global $DIC
Definition: saml.php:7
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
Confirmation screen class.
+ Here is the call graph for this function:

◆ getDatatype()

ilDclBaseFieldModel::getDatatype ( )
Returns
ilDclDatatype

Definition at line 313 of file class.ilDclBaseFieldModel.php.

References $datatype, and loadDatatype().

Referenced by ilDclFieldFactory\getClassPathByInstance(), and ilDclFieldFactory\getFieldTypeByInstance().

314  {
315  $this->loadDatatype();
316 
317  return $this->datatype;
318  }
loadDatatype()
Load datatype for model.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDatatypeId()

ilDclBaseFieldModel::getDatatypeId ( )

Get datatype_id.

Returns
int

Definition at line 260 of file class.ilDclBaseFieldModel.php.

References $datatypeId, ilDclStandardField\_getDatatypeForId(), getId(), and isStandardField().

Referenced by cloneProperties(), doCreate(), doUpdate(), ilDclSelectionFieldModel\fillPropertiesForm(), fillPropertiesForm(), ilDclStandardField\getRecordQueryFilterObject(), and hasNumericSorting().

261  {
262  if ($this->isStandardField()) {
264  }
265 
266  return $this->datatypeId;
267  }
static _getDatatypeForId($id)
gives you the datatype id of a specified standard field.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDatatypeTitle()

ilDclBaseFieldModel::getDatatypeTitle ( )
Returns
string

Definition at line 324 of file class.ilDclBaseFieldModel.php.

References loadDatatype().

325  {
326  $this->loadDatatype();
327 
328  return $this->datatype->getTitle();
329  }
loadDatatype()
Load datatype for model.
+ Here is the call graph for this function:

◆ getDescription()

ilDclBaseFieldModel::getDescription ( )

Get description.

Returns
string

Definition at line 236 of file class.ilDclBaseFieldModel.php.

References $description.

Referenced by doCreate(), doUpdate(), ilDclSelectionFieldModel\fillPropertiesForm(), fillPropertiesForm(), and ilDclBaseFieldRepresentation\setupInputField().

237  {
238  return $this->description;
239  }
+ Here is the caller graph for this function:

◆ getExportable()

ilDclBaseFieldModel::getExportable ( )
Returns
bool

Definition at line 374 of file class.ilDclBaseFieldModel.php.

References $exportable, and loadExportability().

375  {
376  if (!isset($this->exportable)) {
377  $this->loadExportability();
378  }
379 
380  return $this->exportable;
381  }
loadExportability()
Load exportability.
+ Here is the call graph for this function:

◆ getFieldSettings()

ilDclBaseFieldModel::getFieldSettings ( )

Definition at line 594 of file class.ilDclBaseFieldModel.php.

References getId(), and ActiveRecord\where().

Referenced by doDelete().

595  {
596  return ilDclTableViewFieldSetting::where(array('field' => $this->getId()))->get();
597  }
static where($where, $operator=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getId()

ilDclBaseFieldModel::getId ( )

Get field id.

Returns
int

Definition at line 166 of file class.ilDclBaseFieldModel.php.

References $id.

Referenced by ilDclTextFieldModel\checkValidity(), checkValidityFromForm(), ilDclTextFieldModel\checkValidityOfURLField(), ilDclSelectionFieldModel\cloneProperties(), cloneProperties(), cloneStructure(), doCreate(), ilDclSelectionFieldModel\doDelete(), doDelete(), doRead(), doUpdate(), ilDclStandardField\fillHeaderExcel(), ilDclSelectionFieldModel\fillPropertiesForm(), fillPropertiesForm(), ilDclFieldFactory\getClassPathByInstance(), getDatatypeId(), ilDclFieldFactory\getFieldModelInstanceByClass(), ilDclReferenceFieldModel\getFieldRef(), ilDclCache\getFieldRepresentation(), ilDclFieldFactory\getFieldRepresentationInstance(), getFieldSettings(), ilDclFieldFactory\getFieldTypeByInstance(), ilDclSelectionFieldModel\getProperty(), ilDclFieldFactory\getRecordFieldInstance(), ilDclTextFieldModel\getRecordQueryFilterObject(), ilDclBooleanFieldModel\getRecordQueryFilterObject(), ilDclDatetimeFieldModel\getRecordQueryFilterObject(), ilDclNumberFieldModel\getRecordQueryFilterObject(), ilDclSelectionFieldModel\getRecordQueryFilterObject(), ilDclFileuploadFieldModel\getRecordQueryFilterObject(), ilDclIliasReferenceFieldModel\getRecordQueryFilterObject(), ilDclReferenceFieldModel\getRecordQueryFilterObject(), ilDclIliasReferenceFieldModel\getRecordQuerySortObject(), ilDclFileuploadFieldModel\getRecordQuerySortObject(), ilDclReferenceFieldModel\getRecordQuerySortObject(), ilDclSelectionFieldModel\getRecordQuerySortObject(), ilDclStandardField\getRecordQuerySortObject(), getRecordQuerySortObject(), ilDclStandardField\getSortField(), ilDclStandardField\hasNumericSorting(), loadProperties(), loadTableFieldSetting(), ilDclSelectionFieldModel\multiPropertyChanged(), ilDclSelectionFieldModel\reorderExistingValues(), ilDclSelectionFieldModel\setProperty(), setProperty(), and updateTableFieldSetting().

167  {
168  return $this->id;
169  }
+ Here is the caller graph for this function:

◆ getLocked()

ilDclBaseFieldModel::getLocked ( )
Returns
boolean

Definition at line 730 of file class.ilDclBaseFieldModel.php.

References $locked.

Referenced by doCreate(), and doUpdate().

731  {
732  return $this->locked;
733  }
+ Here is the caller graph for this function:

◆ getOrder()

ilDclBaseFieldModel::getOrder ( )
Returns
int

Definition at line 603 of file class.ilDclBaseFieldModel.php.

References $order, and loadTableFieldSetting().

604  {
605  if ($this->order == null) {
606  $this->loadTableFieldSetting();
607  }
608 
609  return !$this->order ? 0 : $this->order;
610  }
loadTableFieldSetting()
loadTableFieldSetting
+ Here is the call graph for this function:

◆ getProperty()

ilDclBaseFieldModel::getProperty (   $key)

Returns a certain property of a field.

Parameters
$key
Returns
null

Definition at line 655 of file class.ilDclBaseFieldModel.php.

References $key, and getPropertyInstance().

Referenced by ilDclTextFieldModel\checkRegexAndLength(), ilDclTextFieldModel\checkValidity(), ilDclTextFieldModel\checkValidityFromForm(), cloneProperties(), ilDclTextFieldModel\fillHeaderExcel(), fillPropertiesForm(), ilDclFieldFactory\getClassPathByInstance(), ilDclReferenceFieldModel\getFieldRef(), ilDclFieldFactory\getFieldTypeByInstance(), ilDclReferenceFieldModel\getRecordQueryFilterObject(), ilDclReferenceFieldModel\getRecordQuerySortObject(), and ilDclFileuploadFieldModel\getSupportedExtensions().

656  {
657  $instance = $this->getPropertyInstance($key);
658 
659  return ($instance !== null) ? $instance->getValue() : null;
660  }
getPropertyInstance($key)
Return ActiveRecord of property.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPropertyInstance()

ilDclBaseFieldModel::getPropertyInstance (   $key)

Return ActiveRecord of property.

Parameters
$key
Returns
null

Definition at line 670 of file class.ilDclBaseFieldModel.php.

References $key, hasProperty(), and loadProperties().

Referenced by getProperty(), ilDclSelectionFieldModel\storePropertiesFromForm(), and storePropertiesFromForm().

671  {
672  $this->loadProperties();
673  if ($this->hasProperty($key)) {
674  $value = $this->property[$key];
675 
676  return $value;
677  }
678 
679  return null;
680  }
loadProperties()
Get all properties of a field.
hasProperty($key)
Checks if a certain property for a field is set.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecordQueryFilterObject()

ilDclBaseFieldModel::getRecordQueryFilterObject (   $filter_value = "",
ilDclBaseFieldModel  $sort_field = null 
)

Returns a query-object for building the record-loader-sql-query.

Parameters
string$filter_value
ilDclBaseFieldModel | null$sort_field
Returns
null|ilDclRecordQueryObject

Definition at line 908 of file class.ilDclBaseFieldModel.php.

909  {
910  return null;
911  }

◆ getRecordQuerySortObject()

ilDclBaseFieldModel::getRecordQuerySortObject (   $direction = "asc",
  $sort_by_status = false 
)

Returns a query-object for building the record-loader-sql-query.

Parameters
string$direction
boolean$sort_by_statusThe specific sort object is a status field
Returns
null|ilDclRecordQueryObject

Definition at line 879 of file class.ilDclBaseFieldModel.php.

References $DIC, $ilDB, and getId().

880  {
881  global $DIC;
882  $ilDB = $DIC['ilDB'];
883 
884  $sql_obj = new ilDclRecordQueryObject();
885 
886  $select_str = "sort_stloc_{$this->getId()}.value AS field_{$this->getId()}";
887  $join_str
888  = "LEFT JOIN il_dcl_record_field AS sort_record_field_{$this->getId()} ON (sort_record_field_{$this->getId()}.record_id = record.id AND sort_record_field_{$this->getId()}.field_id = "
889  . $ilDB->quote($this->getId(), 'integer') . ") ";
890  $join_str .= "LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS sort_stloc_{$this->getId()} ON (sort_stloc_{$this->getId()}.record_field_id = sort_record_field_{$this->getId()}.id)";
891 
892  $sql_obj->setSelectStatement($select_str);
893  $sql_obj->setJoinStatement($join_str);
894  $sql_obj->setOrderStatement("field_{$this->getId()} {$direction}");
895 
896  return $sql_obj;
897  }
Class ilDclRecordQueryObject.
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ getRequired()

ilDclBaseFieldModel::getRequired ( )

Get Required Required.

Returns
boolean

Definition at line 286 of file class.ilDclBaseFieldModel.php.

References $required.

Referenced by doCreate(), doUpdate(), ilDclSelectionFieldModel\fillPropertiesForm(), fillPropertiesForm(), and ilDclBaseFieldRepresentation\setupInputField().

287  {
288  return $this->required;
289  }
+ Here is the caller graph for this function:

◆ getSortField()

ilDclBaseFieldModel::getSortField ( )

Returns the sort-field id.

Returns
string

Definition at line 919 of file class.ilDclBaseFieldModel.php.

References getTitle().

920  {
921  return $this->getTitle();
922  }
+ Here is the call graph for this function:

◆ getStorageLocation()

ilDclBaseFieldModel::getStorageLocation ( )

Get storage location for the model.

Returns
int|null

Definition at line 337 of file class.ilDclBaseFieldModel.php.

References getStorageLocationOverride(), and loadDatatype().

338  {
339  if ($this->getStorageLocationOverride() !== null) {
340  return $this->getStorageLocationOverride();
341  }
342 
343  $this->loadDatatype();
344 
345  return $this->datatype->getStorageLocation();
346  }
loadDatatype()
Load datatype for model.
+ Here is the call graph for this function:

◆ getStorageLocationOverride()

ilDclBaseFieldModel::getStorageLocationOverride ( )
Returns
int|null

Definition at line 956 of file class.ilDclBaseFieldModel.php.

References $storage_location_override.

Referenced by getStorageLocation().

+ Here is the caller graph for this function:

◆ getTableId()

◆ getTitle()

◆ getValidFieldProperties()

ilDclBaseFieldModel::getValidFieldProperties ( )

Returns all valid properties for a field-type.

Returns
array

Definition at line 712 of file class.ilDclBaseFieldModel.php.

Referenced by cloneProperties(), fillPropertiesForm(), and storePropertiesFromForm().

713  {
714  return array();
715  }
+ Here is the caller graph for this function:

◆ hasNumericSorting()

ilDclBaseFieldModel::hasNumericSorting ( )

Set to true, when the sorting should be handled numerical.

Returns
bool

Definition at line 930 of file class.ilDclBaseFieldModel.php.

References getDatatypeId(), and ilDclDatatype\INPUTFORMAT_NUMBER.

931  {
933  return true;
934  }
935 
936  return false;
937  }
getDatatypeId()
Get datatype_id.
+ Here is the call graph for this function:

◆ hasProperty()

ilDclBaseFieldModel::hasProperty (   $key)

Checks if a certain property for a field is set.

Parameters
$key
Returns
bool

Definition at line 640 of file class.ilDclBaseFieldModel.php.

References $key, loadProperties(), and Sabre\VObject\property.

Referenced by ilDclTextFieldModel\checkTitlesForImport(), ilDclFieldFactory\getClassPathByInstance(), ilDclFieldFactory\getFieldTypeByInstance(), getPropertyInstance(), ilDclReferenceFieldModel\getRecordQuerySortObject(), ilDclTextFieldModel\getRecordQuerySortObject(), and ilDclFileuploadFieldModel\getSupportedExtensions().

641  {
642  $this->loadProperties();
643 
644  return (isset($this->property[$key]) && $this->property[$key]->getValue() != null);
645  }
loadProperties()
Get all properties of a field.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isConfirmationRequired()

ilDclBaseFieldModel::isConfirmationRequired ( ilPropertyFormGUI  $form)

called by ilDclFieldEditGUI when updating field properties if you overwrite this method, remember to also overwrite getConfirmationGUI

Parameters
ilPropertyFormGUI$form
Returns
bool

Definition at line 1058 of file class.ilDclBaseFieldModel.php.

1059  {
1060  return false;
1061  }

◆ isStandardField()

ilDclBaseFieldModel::isStandardField ( )
Returns
bool

Definition at line 407 of file class.ilDclBaseFieldModel.php.

Referenced by getDatatypeId().

408  {
409  return false;
410  }
+ Here is the caller graph for this function:

◆ isUnique()

◆ loadDatatype()

ilDclBaseFieldModel::loadDatatype ( )
protected

Load datatype for model.

Definition at line 352 of file class.ilDclBaseFieldModel.php.

References ilDclCache\getDatatype().

Referenced by getDatatype(), getDatatypeTitle(), and getStorageLocation().

353  {
354  if ($this->datatype == null) {
355  $this->datatype = ilDclCache::getDatatype($this->datatypeId);
356  }
357  }
static getDatatype($datatyp_id)
Get cached datatypes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadExportability()

ilDclBaseFieldModel::loadExportability ( )
private

Load exportability.

Definition at line 387 of file class.ilDclBaseFieldModel.php.

References loadTableFieldSetting().

Referenced by getExportable().

388  {
389  if ($this->exportable == null) {
390  $this->loadTableFieldSetting();
391  }
392  }
loadTableFieldSetting()
loadTableFieldSetting
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadProperties()

ilDclBaseFieldModel::loadProperties ( )
protected

Get all properties of a field.

Returns
array

Definition at line 627 of file class.ilDclBaseFieldModel.php.

References ilDclCache\getFieldProperties(), and getId().

Referenced by doRead(), getPropertyInstance(), hasProperty(), and setProperty().

628  {
629  $this->property = ilDclCache::getFieldProperties($this->getId());
630  }
static getFieldProperties($field_id)
Cache Field properties.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadTableFieldSetting()

ilDclBaseFieldModel::loadTableFieldSetting ( )
protected

loadTableFieldSetting

Definition at line 363 of file class.ilDclBaseFieldModel.php.

References getId(), ilDclTableFieldSetting\getInstance(), and getTableId().

Referenced by doRead(), getOrder(), and loadExportability().

364  {
365  $tablefield_setting = ilDclTableFieldSetting::getInstance($this->getTableId(), $this->getId());
366  $this->exportable = $tablefield_setting->isExportable();
367  $this->order = $tablefield_setting->getFieldOrder();
368  }
static getInstance($table_id, $field)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalizeValue()

ilDclBaseFieldModel::normalizeValue (   $value)
protected
Parameters
$value
Returns
string

Definition at line 781 of file class.ilDclBaseFieldModel.php.

Referenced by ilDclTextFieldModel\checkValidity(), ilDclFileuploadFieldModel\checkValidity(), and checkValidity().

782  {
783  if (is_string($value)) {
784  $value = trim(preg_replace("/\\s+/uism", " ", $value));
785  }
786 
787  return $value;
788  }
+ Here is the caller graph for this function:

◆ setDatatypeId()

ilDclBaseFieldModel::setDatatypeId (   $a_id)

Set datatype id.

Parameters
int$a_id

Definition at line 247 of file class.ilDclBaseFieldModel.php.

Referenced by buildFromDBRecord(), cloneStructure(), and doRead().

248  {
249  //unset the cached datatype.
250  $this->datatype = null;
251  $this->datatypeId = $a_id;
252  }
+ Here is the caller graph for this function:

◆ setDescription()

ilDclBaseFieldModel::setDescription (   $a_desc)

Set description.

Parameters
string$a_desc

Definition at line 225 of file class.ilDclBaseFieldModel.php.

Referenced by buildFromDBRecord(), cloneStructure(), and doRead().

226  {
227  $this->description = $a_desc;
228  }
+ Here is the caller graph for this function:

◆ setExportable()

ilDclBaseFieldModel::setExportable (   $exportable)
Parameters
boolean$exportable

Definition at line 856 of file class.ilDclBaseFieldModel.php.

References $exportable.

Referenced by ilDclStandardField\cloneStructure(), and cloneStructure().

857  {
858  $this->exportable = $exportable;
859  }
+ Here is the caller graph for this function:

◆ setId()

ilDclBaseFieldModel::setId (   $a_id)

Set field id.

Parameters
int$a_id

Definition at line 155 of file class.ilDclBaseFieldModel.php.

Referenced by buildFromDBRecord(), and doCreate().

156  {
157  $this->id = $a_id;
158  }
+ Here is the caller graph for this function:

◆ setLocked()

ilDclBaseFieldModel::setLocked (   $locked)
Parameters
boolean$locked

Definition at line 721 of file class.ilDclBaseFieldModel.php.

References $locked.

Referenced by buildFromDBRecord(), ilDclStandardField\cloneStructure(), cloneStructure(), doCreate(), and doRead().

722  {
723  $this->locked = $locked;
724  }
+ Here is the caller graph for this function:

◆ setOrder()

ilDclBaseFieldModel::setOrder (   $order)
Parameters
$order

Definition at line 616 of file class.ilDclBaseFieldModel.php.

References $order.

Referenced by ilDclStandardField\cloneStructure(), and cloneStructure().

617  {
618  $this->order = $order;
619  }
+ Here is the caller graph for this function:

◆ setProperty()

ilDclBaseFieldModel::setProperty (   $key,
  $value 
)

Set a property for a field (does not save)

Parameters
$key
$value

Definition at line 689 of file class.ilDclBaseFieldModel.php.

References $key, $property, getId(), loadProperties(), and Sabre\VObject\property.

Referenced by ilDclReferenceFieldModel\getFieldRef(), and storePropertiesFromForm().

690  {
691  $this->loadProperties();
692  if (isset($this->property[$key])) {
693  $this->property[$key]->setValue($value);
694  } else {
696  $property->setName($key);
697  $property->setFieldId($this->getId());
698  $property->setValue($value);
699 
700  $this->property[$key] = $property;
701  }
702 
703  return $this->property[$key];
704  }
Class ilDclFieldProperty.
loadProperties()
Get all properties of a field.
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRequired()

ilDclBaseFieldModel::setRequired (   $a_required)

Set Required.

Parameters
boolean$a_requiredRequired

Definition at line 275 of file class.ilDclBaseFieldModel.php.

Referenced by buildFromDBRecord(), ilDclStandardField\cloneStructure(), cloneStructure(), and doRead().

276  {
277  $this->required = $a_required;
278  }
+ Here is the caller graph for this function:

◆ setStorageLocationOverride()

ilDclBaseFieldModel::setStorageLocationOverride (   $storage_location_override)
Parameters
int | null$storage_location_override

Definition at line 965 of file class.ilDclBaseFieldModel.php.

References $storage_location_override.

966  {
967  $this->storage_location_override = $storage_location_override;
968  }

◆ setTableId()

ilDclBaseFieldModel::setTableId (   $a_id)

Set table id.

Parameters
int$a_id

Definition at line 177 of file class.ilDclBaseFieldModel.php.

Referenced by buildFromDBRecord(), and doRead().

178  {
179  $this->table_id = $a_id;
180  }
+ Here is the caller graph for this function:

◆ setTitle()

ilDclBaseFieldModel::setTitle (   $a_title)

Set title.

Parameters
string$a_title

Definition at line 199 of file class.ilDclBaseFieldModel.php.

Referenced by buildFromDBRecord(), cloneStructure(), and doRead().

200  {
201  //title cannot begin with _ as this is saved for other purposes. make __ instead.
202  if (substr($a_title, 0, 1) == "_" && substr($a_title, 0, 2) != "__") {
203  $a_title = "_" . $a_title;
204  }
205  $this->title = $a_title;
206  }
+ Here is the caller graph for this function:

◆ setUnique()

ilDclBaseFieldModel::setUnique (   $unique)
Parameters
bool$unique

Definition at line 304 of file class.ilDclBaseFieldModel.php.

References $unique.

Referenced by buildFromDBRecord(), ilDclStandardField\cloneStructure(), cloneStructure(), and doRead().

305  {
306  $this->unique = $unique ? 1 : 0;
307  }
+ Here is the caller graph for this function:

◆ storePropertiesFromForm()

ilDclBaseFieldModel::storePropertiesFromForm ( ilPropertyFormGUI  $form)

called when saving the 'edit field' form

Parameters
ilPropertyFormGUI$form

Definition at line 1005 of file class.ilDclBaseFieldModel.php.

References $property, ilDclFieldFactory\getFieldRepresentationInstance(), ilPropertyFormGUI\getInput(), getPropertyInstance(), getValidFieldProperties(), and setProperty().

1006  {
1007  $field_props = $this->getValidFieldProperties();
1008  foreach ($field_props as $property) {
1009  $representation = ilDclFieldFactory::getFieldRepresentationInstance($this);
1010  $value = $form->getInput($representation->getPropertyInputFieldId($property));
1011 
1012  // save non empty values and set them to null, when they already exist. Do not override plugin-hook when already set.
1013  if (!empty($value) || ($this->getPropertyInstance($property) != null && $property != self::PROP_PLUGIN_HOOK_NAME)) {
1014  $this->setProperty($property, $value)->store();
1015  }
1016  }
1017  }
static getFieldRepresentationInstance(ilDclBaseFieldModel $field)
Returns FieldRepresentation from BaseFieldModel.
getPropertyInstance($key)
Return ActiveRecord of property.
setProperty($key, $value)
Set a property for a field (does not save)
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
getValidFieldProperties()
Returns all valid properties for a field-type.
+ Here is the call graph for this function:

◆ toArray()

ilDclBaseFieldModel::toArray ( )
Returns
array

Definition at line 398 of file class.ilDclBaseFieldModel.php.

399  {
400  return (array) $this;
401  }

◆ updateProperties()

ilDclBaseFieldModel::updateProperties ( )

Update properties of this field in Database.

Definition at line 550 of file class.ilDclBaseFieldModel.php.

References Sabre\VObject\property.

Referenced by doUpdate(), and ilDclReferenceFieldModel\getFieldRef().

551  {
552  foreach ($this->property as $prop) {
553  $prop->store();
554  }
555  }
+ Here is the caller graph for this function:

◆ updateTableFieldSetting()

ilDclBaseFieldModel::updateTableFieldSetting ( )
protected

update exportable and fieldorder

Definition at line 562 of file class.ilDclBaseFieldModel.php.

References getId(), ilDclTableFieldSetting\getInstance(), and getTableId().

Referenced by doCreate(), ilDclStandardField\doUpdate(), and doUpdate().

563  {
564  $tablefield_setting = ilDclTableFieldSetting::getInstance($this->getTableId(), $this->getId());
565  $tablefield_setting->setExportable($this->exportable);
566  $tablefield_setting->setFieldOrder($this->order);
567  $tablefield_setting->store();
568  }
static getInstance($table_id, $field)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $datatype

ilDclBaseFieldModel::$datatype
protected

◆ $datatypeId

ilDclBaseFieldModel::$datatypeId
protected

Definition at line 37 of file class.ilDclBaseFieldModel.php.

Referenced by getDatatypeId().

◆ $description

ilDclBaseFieldModel::$description
protected

Definition at line 33 of file class.ilDclBaseFieldModel.php.

Referenced by getDescription().

◆ $exportable

ilDclBaseFieldModel::$exportable
protected

Definition at line 61 of file class.ilDclBaseFieldModel.php.

Referenced by getExportable(), and setExportable().

◆ $id

◆ $locked

ilDclBaseFieldModel::$locked
protected

Definition at line 53 of file class.ilDclBaseFieldModel.php.

Referenced by getLocked(), and setLocked().

◆ $order

ilDclBaseFieldModel::$order
protected

Definition at line 45 of file class.ilDclBaseFieldModel.php.

Referenced by getOrder(), and setOrder().

◆ $property

ilDclBaseFieldModel::$property = array()
protected

◆ $required

ilDclBaseFieldModel::$required
protected

Definition at line 41 of file class.ilDclBaseFieldModel.php.

Referenced by getRequired().

◆ $storage_location_override

ilDclBaseFieldModel::$storage_location_override = null
protected

◆ $table_id

ilDclBaseFieldModel::$table_id
protected

◆ $title

◆ $unique

ilDclBaseFieldModel::$unique
protected

Definition at line 49 of file class.ilDclBaseFieldModel.php.

Referenced by isUnique(), and setUnique().

◆ EDIT_VIEW

const ilDclBaseFieldModel::EDIT_VIEW = 2

Definition at line 94 of file class.ilDclBaseFieldModel.php.

◆ EXPORTABLE_VIEW

const ilDclBaseFieldModel::EXPORTABLE_VIEW = 4

Definition at line 95 of file class.ilDclBaseFieldModel.php.

◆ PROP_DATE_SELECTION_OPTIONS

const ilDclBaseFieldModel::PROP_DATE_SELECTION_OPTIONS = "date_selection_options"

Definition at line 91 of file class.ilDclBaseFieldModel.php.

◆ PROP_DATE_SELECTION_TYPE

const ilDclBaseFieldModel::PROP_DATE_SELECTION_TYPE = "date_selection_type"

Definition at line 92 of file class.ilDclBaseFieldModel.php.

◆ PROP_DISPLAY_COPY_LINK_ACTION_MENU

const ilDclBaseFieldModel::PROP_DISPLAY_COPY_LINK_ACTION_MENU = "display_action_menu"

◆ PROP_FORMULA_EXPRESSION

const ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION = "expression"

◆ PROP_HEIGHT

◆ PROP_ILIAS_REFERENCE_LINK

◆ PROP_LEARNING_PROGRESS

const ilDclBaseFieldModel::PROP_LEARNING_PROGRESS = "learning_progress"

◆ PROP_LENGTH

◆ PROP_LINK_DETAIL_PAGE_TEXT

◆ PROP_N_REFERENCE

◆ PROP_PLUGIN_HOOK_NAME

◆ PROP_REFERENCE

◆ PROP_REFERENCE_LINK

◆ PROP_REGEX

◆ PROP_SUPPORTED_FILE_TYPES

const ilDclBaseFieldModel::PROP_SUPPORTED_FILE_TYPES = "supported_file_types"

◆ PROP_TEXT_SELECTION_OPTIONS

const ilDclBaseFieldModel::PROP_TEXT_SELECTION_OPTIONS = "text_selection_options"

Definition at line 89 of file class.ilDclBaseFieldModel.php.

◆ PROP_TEXT_SELECTION_TYPE

const ilDclBaseFieldModel::PROP_TEXT_SELECTION_TYPE = "text_selection_type"

Definition at line 90 of file class.ilDclBaseFieldModel.php.

◆ PROP_TEXTAREA

◆ PROP_URL

◆ PROP_WIDTH


The documentation for this class was generated from the following file: