24        return array(static::PROP_SELECTION_OPTIONS, static::PROP_SELECTION_TYPE);
 
   41            = 
" 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 = " 
   42            . 
$ilDB->quote($this->
getId(), 
'integer') . 
") ";
 
   44        $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";
 
   47        if ($filter_value == 
'none') {
 
   49                . 
"filter_stloc_{$this->getId()}.value IS NULL " 
   50                . 
" OR filter_stloc_{$this->getId()}.value = " . 
$ilDB->quote(
"", 
'text')
 
   51                . 
" OR filter_stloc_{$this->getId()}.value = " . 
$ilDB->quote(
"[]", 
'text')
 
   56                    "filter_stloc_{$this->getId()}.value = " . 
$ilDB->quote(
"[$filter_value]", 
'text') . 
" OR " .
 
   57                    "filter_stloc_{$this->getId()}.value LIKE " . 
$ilDB->quote(
"%\"$filter_value\"%", 
'text') . 
" OR " .
 
   58                    "filter_stloc_{$this->getId()}.value LIKE " . 
$ilDB->quote(
"%,$filter_value,%", 
'text') . 
" OR " .
 
   59                    "filter_stloc_{$this->getId()}.value LIKE " . 
$ilDB->quote(
"%[$filter_value,%", 
'text') . 
" OR " .
 
   60                    "filter_stloc_{$this->getId()}.value LIKE " . 
$ilDB->quote(
"%,$filter_value]%", 
'text') .
 
   63                $where_str .= 
"filter_stloc_{$this->getId()}.value = " 
   64                    . 
$ilDB->quote($filter_value, 
'integer');
 
   71        $sql_obj->setJoinStatement($join_str);
 
   72        $sql_obj->setWhereStatement($where_str);
 
   80        return ($this->
getProperty(static::PROP_SELECTION_TYPE) == self::SELECTION_TYPE_MULTI);
 
  101            if (is_array($value)) {
 
  102                foreach ($value as $k => $v) {
 
  104                        $value[$k] = array_shift($v);
 
  126            'field_id' => $this->
getId(),
 
  135        foreach ($properties as $prop) {
 
  136            if ($prop == static::PROP_SELECTION_OPTIONS) {
 
  138                $prop_values = array();
 
  139                foreach ($options as $option) {
 
  141                    $prop_values[$option->getOptId()] = array(
'selection_value' => $option->getValue());
 
  144                $values[
'prop_' . $prop] = $prop_values;
 
  146                $values[
'prop_' . $prop] = $this->
getProperty($prop);
 
  164            case static::PROP_SELECTION_OPTIONS:
 
  168                foreach ($value as 
$id => $val) {
 
  169                    ilDclSelectionOption::storeOption($this->
getId(), 
$id, $sorting, $val);
 
  177            case static::PROP_SELECTION_TYPE:
 
  180                if ($is_update && ($this->
isMulti() && !$will_be_multi || !$this->
isMulti() && $will_be_multi)) {
 
  183                parent::setProperty($key, $value)->store();
 
  186                parent::setProperty($key, $value)->store();
 
  199            $record_field = $record->getRecordField($this->
getId());
 
  200            $record_field_value = $record_field->getValue();
 
  202            if (is_array($record_field_value) && count($record_field_value) > 1) {
 
  203                $sorted_array = array();
 
  205                foreach ($options as $option) {
 
  206                    if (in_array($option->getOptId(), $record_field_value)) {
 
  207                        $sorted_array[] = $option->getOptId();
 
  210                $record_field->setValue($sorted_array);
 
  211                $record_field->doUpdate();
 
  225            $record_field = $record->getRecordField($this->
getId());
 
  226            $record_field_value = $record_field->getValue();
 
  228            if ($record_field_value && !is_array($record_field_value) && $is_multi_now) {
 
  229                $record_field->setValue(array($record_field_value));
 
  230                $record_field->doUpdate();
 
  232                if (is_array($record_field_value) && !$is_multi_now) {
 
  233                    $record_field->setValue(array_shift($record_field_value));
 
  234                    $record_field->doUpdate();
 
  249            case static::PROP_SELECTION_OPTIONS:
 
  253                return parent::getProperty($key);
 
  275        $select_str = 
"sel_opts_{$this->getId()}.value AS field_{$this->getId()}";
 
  277            = 
"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 = " 
  278            . 
$ilDB->quote($this->
getId(), 
'integer') . 
") ";
 
  279        $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) ";
 
  283        $join_str .= 
"LEFT JOIN il_dcl_sel_opts as sel_opts_{$this->getId()} ON (sel_opts_{$this->getId()}.opt_id = sort_stloc_{$this->getId()}.value AND sel_opts_{$this->getId()}.field_id = " 
  284            . 
$ilDB->quote($this->
getId(), 
'integer') . 
") ";
 
  287        $sql_obj->setSelectStatement($select_str);
 
  288        $sql_obj->setJoinStatement($join_str);
 
  289        $sql_obj->setOrderStatement(
"field_{$this->getId()} {$direction}");
 
  297        parent::cloneProperties($originalField);
 
  299        foreach ($options as $opt) {
 
  301            $new_opt->cloneOption($opt);
 
  302            $new_opt->setFieldId($this->
getId());
 
  327        return $this->
isMulti() && !$will_be_multi;
 
  338        $prop_selection_options = $representation->getPropertyInputFieldId(static::PROP_SELECTION_OPTIONS);
 
  339        $prop_selection_type = $representation->getPropertyInputFieldId(static::PROP_SELECTION_TYPE);
 
  341        $ilConfirmationGUI = parent::getConfirmationGUI($form);
 
  342        $ilConfirmationGUI->setHeaderText(
$DIC->language()->txt(
'dcl_msg_mc_to_sc_confirmation'));
 
  343        $ilConfirmationGUI->addHiddenItem($prop_selection_type, $form->
getInput($prop_selection_type));
 
  344        foreach ($form->
getInput($prop_selection_options) as $key => $option) {
 
  345            $ilConfirmationGUI->addHiddenItem($prop_selection_options . 
"[$key][selection_value]", $option[
'selection_value']);
 
  348        return $ilConfirmationGUI;
 
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
getPropertyInstance($key)
Return ActiveRecord of property.
getDescription()
Get description.
getRequired()
Get Required Required.
getTableId()
Get table id.
getDatatypeId()
Get datatype_id.
static getTableCache($table_id=0)
static getFieldRepresentationInstance(ilDclBaseFieldModel $field)
Returns FieldRepresentation from BaseFieldModel.
Class ilDclRecordQueryObject.
Class ilDclSelectionFieldModel.
const PROP_SELECTION_OPTIONS
fillPropertiesForm(ilPropertyFormGUI &$form)
doDelete()
Remove field and properties.
cloneProperties(ilDclBaseFieldModel $originalField)
const PROP_SELECTION_TYPE
const SELECTION_TYPE_COMBOBOX
setProperty($key, $value)
const SELECTION_TYPE_SINGLE
reorderExistingValues()
sorts record field values by the new order
getConfirmationGUI(ilPropertyFormGUI $form)
called by ilDclFieldEditGUI if isConfirmationRequired returns trueilConfirmationGUI
multiPropertyChanged($is_multi_now)
changes the values of all record fields, since the property "multi" has changed
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
storePropertiesFromForm(ilPropertyFormGUI $form)
called when saving the 'edit field' form
getRecordQuerySortObject($direction="asc", $sort_by_status=false)
const SELECTION_TYPE_MULTI
getValidFieldProperties()
@inheritDoc
isConfirmationRequired(ilPropertyFormGUI $form)
called by ilDclFieldEditGUI when updating field properties if you overwrite this method,...
Class ilDclSelectionOption.
static getAllForField($field_id)
static flushOptions($field_id)