ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 104 of file class.ilDclBaseFieldModel.php.

References doRead().

105  {
106  if ($a_id != 0) {
107  $this->id = $a_id;
108  $this->doRead();
109  }
110  }
+ 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 136 of file class.ilDclBaseFieldModel.php.

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

137  {
138  global $DIC;
139  $ilDB = $DIC['ilDB'];
140  $result = $ilDB->query('SELECT id FROM il_dcl_field WHERE title = ' . $ilDB->quote($title, 'text') . ' AND table_id = '
141  . $ilDB->quote($table_id, 'integer'));
142  $id = 0;
143  while ($rec = $ilDB->fetchAssoc($result)) {
144  $id = $rec['id'];
145  }
146 
147  return $id;
148  }
$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 120 of file class.ilDclBaseFieldModel.php.

Referenced by ilDclFieldEditGUI\initForm().

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

◆ addToTableViews()

ilDclBaseFieldModel::addToTableViews ( )
protected

create ilDclTableViewFieldSettings for this field in each tableview

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

References ilDclTableView\getAllForTableId().

Referenced by doCreate().

480  {
481  foreach (ilDclTableView::getAllForTableId($this->table_id) as $tableview) {
482  $tableview->createFieldSetting($this->id);
483  }
484  }
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 792 of file class.ilDclBaseFieldModel.php.

References $records, and ilDclCache\getRecordFieldCache().

Referenced by ilDclReferenceFieldModel\getFieldRef().

793  {
794  foreach ($records as $rec) {
795  ilDclCache::getRecordFieldCache($rec, $this)->afterClone();
796  }
797  }
$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 837 of file class.ilDclBaseFieldModel.php.

838  {
839  return true;
840  }

◆ buildFromDBRecord()

ilDclBaseFieldModel::buildFromDBRecord (   $rec)

Builds model from db record.

Parameters
$rec

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

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

437  {
438  $this->setId($rec["id"]);
439  $this->setTableId($rec["table_id"]);
440  $this->setTitle($rec["title"]);
441  $this->setDescription($rec["description"]);
442  $this->setDatatypeId($rec["datatype_id"]);
443  $this->setRequired($rec["required"]);
444  $this->setUnique($rec["is_unique"]);
445  $this->setLocked($rec["is_locked"]);
446  }
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 913 of file class.ilDclBaseFieldModel.php.

914  {
915  return true;
916  }

◆ checkTitlesForImport()

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

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

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

954  {
955  foreach ($titles as $k => $title) {
956  if (!ilStr::isUtf8($title)) {
957  $title = utf8_encode($title);
958  }
959  if ($title == $this->getTitle()) {
960  $import_fields[$k] = $this;
961  }
962  }
963  }
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 729 of file class.ilDclBaseFieldModel.php.

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

Referenced by checkValidityFromForm().

730  {
731  //Don't check empty values
732  if ($value == null) {
733  return true;
734  }
735 
736  if ($this->isUnique()) {
738  foreach ($table->getRecords() as $record) {
739  if ($this->normalizeValue($record->getRecordFieldValue($this->getId())) == $this->normalizeValue($value) &&
740  ($record->getId() != $record_id || $record_id == 0)) {
742  }
743  }
744  }
745 
746  return true;
747  }
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 716 of file class.ilDclBaseFieldModel.php.

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

717  {
718  $value = $form->getInput('field_' . $this->getId());
719  $this->checkValidity($value, $record_id);
720  }
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 802 of file class.ilDclBaseFieldModel.php.

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

Referenced by cloneStructure().

803  {
804  $orgProps = $originalField->getValidFieldProperties();
805  if (count($orgProps) == 0) {
806  return;
807  }
808  foreach ($orgProps as $prop_name) {
809  $fieldprop_obj = new ilDclFieldProperty();
810  $fieldprop_obj->setFieldId($this->getId());
811  $fieldprop_obj->setName($prop_name);
812 
813  $value = $originalField->getProperty($prop_name);
814 
815  // If reference field, we must reset the referenced field, otherwise it will point to the old ID
817  $value = null;
818  }
819 
820  $fieldprop_obj->setValue($value);
821  $fieldprop_obj->create();
822  }
823  }
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 770 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.

771  {
772  $original = ilDclCache::getFieldCache($original_id);
773  $this->setTitle($original->getTitle());
774  $this->setDatatypeId($original->getDatatypeId());
775  $this->setDescription($original->getDescription());
776  $this->setLocked($original->getLocked());
777  $this->setOrder($original->getOrder());
778  $this->setRequired($original->getRequired());
779  $this->setUnique($original->isUnique());
780  $this->setExportable($original->getExportable());
781  $this->doCreate();
782  $this->cloneProperties($original);
783 
784  // mandatory for all cloning functions
785  ilDclCache::setCloneOf($original_id, $this->getId(), ilDclCache::TYPE_FIELD);
786  }
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 452 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().

453  {
454  global $DIC;
455  $ilDB = $DIC['ilDB'];
456  $this->getLocked() == null ? $this->setLocked(false) : true;
457 
458  if (!ilDclTable::_tableExists($this->getTableId())) {
459  throw new ilException("The field does not have a related table!");
460  }
461 
462  $id = $ilDB->nextId("il_dcl_field");
463  $this->setId($id);
464  $query = "INSERT INTO il_dcl_field (" . "id" . ", table_id" . ", datatype_id" . ", title" . ", description" . ", required" . ", is_unique"
465  . ", is_locked" . " ) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getTableId(), "integer") . ","
466  . $ilDB->quote($this->getDatatypeId(), "integer") . "," . $ilDB->quote($this->getTitle(), "text") . ","
467  . $ilDB->quote($this->getDescription(), "text") . "," . $ilDB->quote($this->getRequired(), "integer") . ","
468  . $ilDB->quote($this->isUnique(), "integer") . "," . $ilDB->quote($this->getLocked() ? 1 : 0, "integer") . ")";
469  $ilDB->manipulate($query);
470 
471  $this->updateTableFieldSetting();
472 
473  $this->addToTableViews();
474  }
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 561 of file class.ilDclBaseFieldModel.php.

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

562  {
563  global $DIC;
564  $ilDB = $DIC['ilDB'];
565 
566  // delete tablefield setting.
567  ilDclTableFieldSetting::getInstance($this->getTableId(), $this->getId())->delete();
568 
569  $query = "DELETE FROM il_dcl_field_prop WHERE field_id = " . $ilDB->quote($this->getId(), "text");
570  $ilDB->manipulate($query);
571 
572  $query = "DELETE FROM il_dcl_field WHERE id = " . $ilDB->quote($this->getId(), "text");
573  $ilDB->manipulate($query);
574 
575  foreach ($this->getFieldSettings() as $field_setting) {
576  $field_setting->delete();
577  }
578  }
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 410 of file class.ilDclBaseFieldModel.php.

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

Referenced by __construct().

411  {
412  global $DIC;
413  $ilDB = $DIC['ilDB'];
414 
415  //THEN 1 ELSE 0 END AS has_options FROM il_dcl_field f WHERE id = ".$ilDB->quote($this->getId(),"integer");
416  $query = "SELECT * FROM il_dcl_field WHERE id = " . $ilDB->quote($this->getId(), "integer");
417  $set = $ilDB->query($query);
418  $rec = $ilDB->fetchAssoc($set);
419 
420  $this->setTableId($rec["table_id"]);
421  $this->setTitle($rec["title"]);
422  $this->setDescription($rec["description"]);
423  $this->setDatatypeId($rec["datatype_id"]);
424  $this->setRequired($rec["required"]);
425  $this->setUnique($rec["is_unique"]);
426  $this->setLocked($rec["is_locked"]);
427  $this->loadProperties();
428  $this->loadTableFieldSetting();
429  }
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 490 of file class.ilDclBaseFieldModel.php.

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

491  {
492  global $DIC;
493  $ilDB = $DIC['ilDB'];
494 
495  $ilDB->update("il_dcl_field", array(
496  "table_id" => array(
497  "integer",
498  $this->getTableId()
499  ),
500  "datatype_id" => array(
501  "text",
502  $this->getDatatypeId()
503  ),
504  "title" => array(
505  "text",
506  $this->getTitle()
507  ),
508  "description" => array(
509  "text",
510  $this->getDescription()
511  ),
512  "required" => array(
513  "integer",
514  $this->getRequired()
515  ),
516  "is_unique" => array(
517  "integer",
518  $this->isUnique()
519  ),
520  "is_locked" => array(
521  "integer",
522  $this->getLocked() ? 1 : 0
523  ),
524  ), array(
525  "id" => array(
526  "integer",
527  $this->getId()
528  )
529  ));
530  $this->updateTableFieldSetting();
531  $this->updateProperties();
532  }
global $DIC
Definition: saml.php:7
updateProperties()
Update properties of this field in Database.
getRequired()
Get Required Required.
Create styles array
The data for the language used.
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 942 of file class.ilDclBaseFieldModel.php.

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

943  {
944  $worksheet->setCell($row, $col, $this->getTitle());
945  $col++;
946  }
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
+ 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 993 of file class.ilDclBaseFieldModel.php.

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

994  {
995  $values = array(
996  'table_id' => $this->getTableId(),
997  'field_id' => $this->getId(),
998  'title' => $this->getTitle(),
999  'datatype' => $this->getDatatypeId(),
1000  'description' => $this->getDescription(),
1001  'required' => $this->getRequired(),
1002  'unique' => $this->isUnique(),
1003  );
1004 
1005  $properties = $this->getValidFieldProperties();
1006  foreach ($properties as $prop) {
1007  $values['prop_' . $prop] = $this->getProperty($prop);
1008  }
1009 
1010  $form->setValuesByArray($values);
1011 
1012  return true;
1013  }
getRequired()
Get Required Required.
Create styles array
The data for the language used.
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 1037 of file class.ilDclBaseFieldModel.php.

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

1038  {
1039  global $DIC;
1040  $ilConfirmationGUI = new ilConfirmationGUI();
1041  $ilConfirmationGUI->setFormAction($form->getFormAction());
1042  $ilConfirmationGUI->addHiddenItem('confirmed', 1);
1043  $ilConfirmationGUI->addHiddenItem('field_id', $form->getInput('field_id'));
1044  $ilConfirmationGUI->addHiddenItem('title', $form->getInput('title'));
1045  $ilConfirmationGUI->addHiddenItem('description', $form->getInput('description'));
1046  $ilConfirmationGUI->addHiddenItem('datatype', $form->getInput('datatype'));
1047  $ilConfirmationGUI->addHiddenItem('required', $form->getInput('required'));
1048  $ilConfirmationGUI->addHiddenItem('unique', $form->getInput('unique'));
1049  $ilConfirmationGUI->setConfirm($DIC->language()->txt('dcl_update_field'), 'update');
1050  $ilConfirmationGUI->setCancel($DIC->language()->txt('cancel'), 'edit');
1051  return $ilConfirmationGUI;
1052  }
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 312 of file class.ilDclBaseFieldModel.php.

References $datatype, and loadDatatype().

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

313  {
314  $this->loadDatatype();
315 
316  return $this->datatype;
317  }
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 261 of file class.ilDclBaseFieldModel.php.

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

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

262  {
263  if ($this->isStandardField()) {
265  }
266 
267  return $this->datatypeId;
268  }
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 323 of file class.ilDclBaseFieldModel.php.

References loadDatatype().

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

◆ getDescription()

ilDclBaseFieldModel::getDescription ( )

Get description.

Returns
string

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

References $description.

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

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

◆ getExportable()

ilDclBaseFieldModel::getExportable ( )
Returns
bool

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

References $exportable, and loadExportability().

370  {
371  if (!isset($this->exportable)) {
372  $this->loadExportability();
373  }
374 
375  return $this->exportable;
376  }
loadExportability()
Load exportability.
+ Here is the call graph for this function:

◆ getFieldSettings()

ilDclBaseFieldModel::getFieldSettings ( )

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

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

Referenced by doDelete().

581  {
582  return ilDclTableViewFieldSetting::where(array('field' => $this->getId()))->get();
583  }
static where($where, $operator=null)
Create styles array
The data for the language used.
+ 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 167 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(), ilDclDatetimeFieldModel\getRecordQueryFilterObject(), ilDclBooleanFieldModel\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().

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

◆ getLocked()

ilDclBaseFieldModel::getLocked ( )
Returns
boolean

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

References $locked.

Referenced by doCreate(), and doUpdate().

707  {
708  return $this->locked;
709  }
+ Here is the caller graph for this function:

◆ getOrder()

ilDclBaseFieldModel::getOrder ( )
Returns
int

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

References $order, and loadTableFieldSetting().

589  {
590  if ($this->order == null) {
591  $this->loadTableFieldSetting();
592  }
593 
594  return !$this->order ? 0 : $this->order;
595  }
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 635 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().

636  {
637  $instance = $this->getPropertyInstance($key);
638 
639  return ($instance !== null)? $instance->getValue() : null;
640  }
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 650 of file class.ilDclBaseFieldModel.php.

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

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

651  {
652  $this->loadProperties();
653  if ($this->hasProperty($key)) {
654  $value = $this->property[$key];
655  return $value;
656  }
657  return null;
658  }
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 878 of file class.ilDclBaseFieldModel.php.

879  {
880  return null;
881  }

◆ 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 851 of file class.ilDclBaseFieldModel.php.

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

852  {
853  global $DIC;
854  $ilDB = $DIC['ilDB'];
855 
856  $sql_obj = new ilDclRecordQueryObject();
857 
858  $select_str = "sort_stloc_{$this->getId()}.value AS field_{$this->getId()}";
859  $join_str = "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 = "
860  . $ilDB->quote($this->getId(), 'integer') . ") ";
861  $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)";
862 
863  $sql_obj->setSelectStatement($select_str);
864  $sql_obj->setJoinStatement($join_str);
865  $sql_obj->setOrderStatement("field_{$this->getId()} {$direction}");
866 
867  return $sql_obj;
868  }
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 287 of file class.ilDclBaseFieldModel.php.

References $required.

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

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

◆ getSortField()

ilDclBaseFieldModel::getSortField ( )

Returns the sort-field id.

Returns
string

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

References getTitle().

889  {
890  return $this->getTitle();
891  }
+ Here is the call graph for this function:

◆ getStorageLocation()

ilDclBaseFieldModel::getStorageLocation ( )

Get storage location for the model.

Returns
int|null

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

References getStorageLocationOverride(), and loadDatatype().

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

◆ getStorageLocationOverride()

ilDclBaseFieldModel::getStorageLocationOverride ( )
Returns
int|null

Definition at line 922 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 689 of file class.ilDclBaseFieldModel.php.

References array.

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

690  {
691  return array();
692  }
Create styles array
The data for the language used.
+ 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 898 of file class.ilDclBaseFieldModel.php.

References getDatatypeId(), and ilDclDatatype\INPUTFORMAT_NUMBER.

899  {
901  return true;
902  }
903  return false;
904  }
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 622 of file class.ilDclBaseFieldModel.php.

References $key, and loadProperties().

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

623  {
624  $this->loadProperties();
625  return (isset($this->property[$key]) && $this->property[$key]->getValue() != null);
626  }
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 1024 of file class.ilDclBaseFieldModel.php.

1025  {
1026  return false;
1027  }

◆ isStandardField()

ilDclBaseFieldModel::isStandardField ( )
Returns
bool

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

Referenced by getDatatypeId().

402  {
403  return false;
404  }
+ Here is the caller graph for this function:

◆ isUnique()

◆ loadDatatype()

ilDclBaseFieldModel::loadDatatype ( )
protected

Load datatype for model.

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

References ilDclCache\getDatatype().

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

350  {
351  if ($this->datatype == null) {
352  $this->datatype = ilDclCache::getDatatype($this->datatypeId);
353  }
354  }
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 381 of file class.ilDclBaseFieldModel.php.

References loadTableFieldSetting().

Referenced by getExportable().

382  {
383  if ($this->exportable == null) {
384  $this->loadTableFieldSetting();
385  }
386  }
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 611 of file class.ilDclBaseFieldModel.php.

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

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

612  {
613  $this->property = ilDclCache::getFieldProperties($this->getId());
614  }
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 359 of file class.ilDclBaseFieldModel.php.

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

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

360  {
361  $tablefield_setting = ilDclTableFieldSetting::getInstance($this->getTableId(), $this->getId());
362  $this->exportable = $tablefield_setting->isExportable();
363  $this->order = $tablefield_setting->getFieldOrder();
364  }
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 755 of file class.ilDclBaseFieldModel.php.

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

756  {
757  if (is_string($value)) {
758  $value = trim(preg_replace("/\\s+/uism", " ", $value));
759  }
760 
761  return $value;
762  }
+ Here is the caller graph for this function:

◆ setDatatypeId()

ilDclBaseFieldModel::setDatatypeId (   $a_id)

Set datatype id.

Parameters
int$a_id

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

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

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

◆ setDescription()

ilDclBaseFieldModel::setDescription (   $a_desc)

Set description.

Parameters
string$a_desc

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

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

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

◆ setExportable()

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

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

References $exportable.

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

830  {
831  $this->exportable = $exportable;
832  }
+ Here is the caller graph for this function:

◆ setId()

ilDclBaseFieldModel::setId (   $a_id)

Set field id.

Parameters
int$a_id

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

Referenced by buildFromDBRecord(), and doCreate().

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

◆ setLocked()

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

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

References $locked.

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

698  {
699  $this->locked = $locked;
700  }
+ Here is the caller graph for this function:

◆ setOrder()

ilDclBaseFieldModel::setOrder (   $order)
Parameters
$order

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

References $order.

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

602  {
603  $this->order = $order;
604  }
+ 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 667 of file class.ilDclBaseFieldModel.php.

References $key, $property, getId(), and loadProperties().

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

668  {
669  $this->loadProperties();
670  if (isset($this->property[$key])) {
671  $this->property[$key]->setValue($value);
672  } else {
674  $property->setName($key);
675  $property->setFieldId($this->getId());
676  $property->setValue($value);
677 
678  $this->property[$key] = $property;
679  }
680 
681  return $this->property[$key];
682  }
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 276 of file class.ilDclBaseFieldModel.php.

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

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

◆ setStorageLocationOverride()

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

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

References $storage_location_override.

932  {
933  $this->storage_location_override = $storage_location_override;
934  }

◆ setTableId()

ilDclBaseFieldModel::setTableId (   $a_id)

Set table id.

Parameters
int$a_id

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

Referenced by buildFromDBRecord(), and doRead().

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

◆ setTitle()

ilDclBaseFieldModel::setTitle (   $a_title)

Set title.

Parameters
string$a_title

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

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

201  {
202  //title cannot begin with _ as this is saved for other purposes. make __ instead.
203  if (substr($a_title, 0, 1) == "_" && substr($a_title, 0, 2) != "__") {
204  $a_title = "_" . $a_title;
205  }
206  $this->title = $a_title;
207  }
+ 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 971 of file class.ilDclBaseFieldModel.php.

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

972  {
973  $field_props = $this->getValidFieldProperties();
974  foreach ($field_props as $property) {
975  $representation = ilDclFieldFactory::getFieldRepresentationInstance($this);
976  $value = $form->getInput($representation->getPropertyInputFieldId($property));
977 
978  // save non empty values and set them to null, when they already exist. Do not override plugin-hook when already set.
979  if (!empty($value) || ($this->getPropertyInstance($property) != null && $property != self::PROP_PLUGIN_HOOK_NAME)) {
980  $this->setProperty($property, $value)->store();
981  }
982  }
983  }
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 392 of file class.ilDclBaseFieldModel.php.

References array.

393  {
394  return (array) $this;
395  }
Create styles array
The data for the language used.

◆ updateProperties()

ilDclBaseFieldModel::updateProperties ( )

Update properties of this field in Database.

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

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

539  {
540  foreach ($this->property as $prop) {
541  $prop->store();
542  }
543  }
+ Here is the caller graph for this function:

◆ updateTableFieldSetting()

ilDclBaseFieldModel::updateTableFieldSetting ( )
protected

update exportable and fieldorder

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

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

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

551  {
552  $tablefield_setting = ilDclTableFieldSetting::getInstance($this->getTableId(), $this->getId());
553  $tablefield_setting->setExportable($this->exportable);
554  $tablefield_setting->setFieldOrder($this->order);
555  $tablefield_setting->store();
556  }
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 98 of file class.ilDclBaseFieldModel.php.

◆ EXPORTABLE_VIEW

const ilDclBaseFieldModel::EXPORTABLE_VIEW = 4

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

◆ PROP_DATE_SELECTION_OPTIONS

const ilDclBaseFieldModel::PROP_DATE_SELECTION_OPTIONS = "date_selection_options"

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

◆ PROP_DATE_SELECTION_TYPE

const ilDclBaseFieldModel::PROP_DATE_SELECTION_TYPE = "date_selection_type"

Definition at line 94 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 91 of file class.ilDclBaseFieldModel.php.

◆ PROP_TEXT_SELECTION_TYPE

const ilDclBaseFieldModel::PROP_TEXT_SELECTION_TYPE = "text_selection_type"

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

◆ PROP_TEXTAREA

◆ PROP_URL

◆ PROP_WIDTH


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