19declare(strict_types=1);
31 return [$this::PROP_SELECTION_OPTIONS, $this::PROP_SELECTION_TYPE, $this::PROP_UNIQUE];
40 =
" LEFT JOIN il_dcl_record_field AS filter_record_field_{$this->getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = "
41 . $this->db->quote($this->
getId(),
'integer') .
") ";
43 $join_str .=
" LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id";
46 if ($filter_value ==
'none') {
48 .
"filter_stloc_{$this->getId()}.value IS NULL "
49 .
" OR filter_stloc_{$this->getId()}.value = " . $this->db->quote(
"",
'text')
50 .
" OR filter_stloc_{$this->getId()}.value = " . $this->db->quote(
"[]",
'text')
55 "filter_stloc_{$this->getId()}.value LIKE " . $this->db->quote(
"%\"$filter_value\"%",
'text') .
58 $where_str .=
"filter_stloc_{$this->getId()}.value = "
59 . $this->db->quote($filter_value,
'integer');
66 $sql_obj->setJoinStatement($join_str);
67 $sql_obj->setWhereStatement($where_str);
74 return ($this->getProperty($this::PROP_SELECTION_TYPE) === $this::SELECTION_TYPE_MULTI);
82 if ($key === $this::PROP_SELECTION_OPTIONS) {
85 foreach ($value as
$id => $val) {
86 ilDclSelectionOption::storeOption((
int) $this->
getId(),
$id, $sorting, $this->sanitizeOptionValue($val));
91 return parent::setProperty($key, $value);
109 if ($key == $this::PROP_SELECTION_OPTIONS) {
112 $prop_values[$option->getOptId()] = $option->getValue();
117 return parent::getProperty($key);
122 parent::cloneProperties($originalField);
124 foreach ($options as $opt) {
126 $new_opt->cloneOption($opt);
127 $new_opt->setFieldId((
int) $this->
getId());
142 return $this->checkUniqueProp($form) && parent::checkFieldCreationInput($form);
147 $this->checkUnique($value, $record_id);
148 return parent::checkValidity($value, $record_id);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
const PROP_SELECTION_OPTIONS
sanitizeOptionValue(string $value)
doDelete()
Remove field and properties.
cloneProperties(ilDclBaseFieldModel $originalField)
const string SELECTION_TYPE_MULTI
const PROP_SELECTION_TYPE
const string SELECTION_TYPE_COMBOBOX
const string SELECTION_TYPE_SINGLE
personalizeOptionValue(string $value, ilObjUser $user)
checkFieldCreationInput(ilPropertyFormGUI $form)
Checks input of specific fields befor saving.
setProperty(string $key, $value)
getValidFieldProperties()
Returns all valid properties for a field-type.
checkValidity($value, ?int $record_id)
Check if input is valid.
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
static getAllForField(int $field_id)
static flushOptions(int $field_id)