ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclSelectionOption Class Reference
+ Inheritance diagram for ilDclSelectionOption:
+ Collaboration diagram for ilDclSelectionOption:

Public Member Functions

 getId ()
 
 setId (int $id)
 
 getFieldId ()
 
 setFieldId (int $field_id)
 
 getOptId ()
 
 setOptId (int $opt_id)
 
 getValue ()
 
 setValue (string $value)
 
 getSorting ()
 
 setSorting (int $sorting)
 
 cloneOption (ilDclSelectionOption $original_option)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 @description Return the Name of your Connector Table More...
 
 setConnectorContainerName (string $connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct (mixed $primary_key=0)
 
 storeObjectToCache ()
 
 asStdClass ()
 
 asArray ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, string $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy (int $new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
static flushOptions (int $field_id)
 
static getAllForField (int $field_id)
 
static getValues (int $field_id, $opt_ids)
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField (string $old_name, string $new_name)
 
static tableExists ()
 
static fieldExists (string $field_name)
 
static removeDBField (string $field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 @depracated never use in ILIAS Core, Plugins only More...
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=[])
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=[])
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $activeRecord, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static innerjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static leftjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static orderBy (string $orderBy, string $orderDirection='ASC')
 
static dateFormat (string $date_format='d.m.Y - H:i:s')
 
static limit (int $start, int $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $arConnector)
 
static raw (bool $set_raw=true)
 
static getArray (?string $key=null, string|array|null $values=null)
 
static _toCamelCase (string $str, bool $capitalise_first_char=false)
 

Data Fields

const DB_TABLE_NAME = "il_dcl_sel_opts"
 

Protected Attributes

int $id
 
int $field_id
 
int $opt_id
 
int $sorting
 
string $value
 
- Protected Attributes inherited from ActiveRecord
bool $ar_safe_read = true
 
string $connector_container_name = ''
 
bool $is_new = true
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 @description Returns an instance of the instatiated calling active record (needs to be done in static methods) @TODO : This should be cached somehow More...
 
static fromCamelCase (string $str)
 

Detailed Description

Definition at line 21 of file class.ilDclSelectionOption.php.

Member Function Documentation

◆ cloneOption()

ilDclSelectionOption::cloneOption ( ilDclSelectionOption  $original_option)
Parameters
ilDclSelectionOption$original_option

Definition at line 182 of file class.ilDclSelectionOption.php.

182 : void
183 {
184 $this->setValue($original_option->getValue());
185 $this->setSorting($original_option->getSorting());
186 $this->setOptId($original_option->getOptId());
187 }

References getOptId(), getSorting(), getValue(), setOptId(), setSorting(), and setValue().

+ Here is the call graph for this function:

◆ flushOptions()

static ilDclSelectionOption::flushOptions ( int  $field_id)
static

Definition at line 138 of file class.ilDclSelectionOption.php.

138 : void
139 {
140 foreach (self::getAllForField($field_id) as $option) {
141 $option->delete();
142 }
143 }

References $field_id.

Referenced by ilDclSelectionFieldModel\setProperty().

+ Here is the caller graph for this function:

◆ getAllForField()

static ilDclSelectionOption::getAllForField ( int  $field_id)
static
Returns
self[]

Definition at line 148 of file class.ilDclSelectionOption.php.

148 : array
149 {
150 return self::where(["field_id" => $field_id])->orderBy('sorting')->get();
151 }
static where($where, $operator=null)

References $field_id, and ActiveRecord\where().

Referenced by ilDclSelectionFieldRepresentation\addFilterInputFieldToTable(), ilDclSelectionFieldModel\cloneProperties(), ilDclSelectionFieldModel\doDelete(), ilDclSelectionFieldRepresentation\getInputField(), and ilDclSelectionFieldModel\getProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFieldId()

ilDclSelectionOption::getFieldId ( )

Definition at line 84 of file class.ilDclSelectionOption.php.

84 : int
85 {
86 return $this->field_id;
87 }

References $field_id.

◆ getId()

ilDclSelectionOption::getId ( )

Definition at line 74 of file class.ilDclSelectionOption.php.

74 : int
75 {
76 return $this->id;
77 }

References $id.

◆ getOptId()

ilDclSelectionOption::getOptId ( )

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

94 : int
95 {
96 return $this->opt_id;
97 }

References $opt_id.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ getSorting()

ilDclSelectionOption::getSorting ( )

Definition at line 114 of file class.ilDclSelectionOption.php.

114 : int
115 {
116 return $this->sorting;
117 }

References $sorting.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ getValue()

ilDclSelectionOption::getValue ( )

Definition at line 104 of file class.ilDclSelectionOption.php.

104 : string
105 {
106 return $this->value;
107 }

References $value.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ getValues()

static ilDclSelectionOption::getValues ( int  $field_id,
  $opt_ids 
)
static
Parameters
array | string | int$opt_ids
Exceptions
arException

Definition at line 157 of file class.ilDclSelectionOption.php.

157 : array
158 {
159 $operators = ['field_id' => '='];
160 if (is_array($opt_ids)) {
161 if (empty($opt_ids)) {
162 return [];
163 }
164 $operators['opt_id'] = 'IN';
165 } else {
166 $operators['opt_id'] = '=';
167 }
168 $return = [];
169 foreach (self::where(
170 ["field_id" => $field_id, "opt_id" => $opt_ids],
171 $operators
172 )->orderBy('sorting')->get() as $opt) {
173 $return[] = $opt->getValue();
174 }
175
176 return $return;
177 }
static orderBy(string $orderBy, string $orderDirection='ASC')

References $field_id, and ActiveRecord\orderBy().

Referenced by ilDclDateSelectionRecordRepresentation\getHTML(), ilDclDatetimeSelectionRecordRepresentation\getHTML(), ilDclSelectionRecordRepresentation\getHTML(), and ilDclSelectionRecordFieldModel\parseExportValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnDbTableName()

static ilDclSelectionOption::returnDbTableName ( )
static
Returns
never
Exceptions

arException

Deprecated:

Reimplemented from ActiveRecord.

Definition at line 25 of file class.ilDclSelectionOption.php.

25 : string
26 {
28 }

References DB_TABLE_NAME.

◆ setFieldId()

ilDclSelectionOption::setFieldId ( int  $field_id)

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

89 : void
90 {
91 $this->field_id = $field_id;
92 }

References $field_id.

◆ setId()

ilDclSelectionOption::setId ( int  $id)

Definition at line 79 of file class.ilDclSelectionOption.php.

79 : void
80 {
81 $this->id = $id;
82 }

References $id.

◆ setOptId()

ilDclSelectionOption::setOptId ( int  $opt_id)

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

99 : void
100 {
101 $this->opt_id = $opt_id;
102 }

References $opt_id.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ setSorting()

ilDclSelectionOption::setSorting ( int  $sorting)

Definition at line 119 of file class.ilDclSelectionOption.php.

119 : void
120 {
121 $this->sorting = $sorting;
122 }

References $sorting.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ setValue()

ilDclSelectionOption::setValue ( string  $value)

Definition at line 109 of file class.ilDclSelectionOption.php.

109 : void
110 {
111 $this->value = $value;
112 }

References $value.

Referenced by cloneOption().

+ Here is the caller graph for this function:

Field Documentation

◆ $field_id

int ilDclSelectionOption::$field_id
protected

◆ $id

int ilDclSelectionOption::$id
protected

Definition at line 40 of file class.ilDclSelectionOption.php.

Referenced by getId(), and setId().

◆ $opt_id

int ilDclSelectionOption::$opt_id
protected

Definition at line 56 of file class.ilDclSelectionOption.php.

Referenced by getOptId(), and setOptId().

◆ $sorting

int ilDclSelectionOption::$sorting
protected

Definition at line 64 of file class.ilDclSelectionOption.php.

Referenced by getSorting(), and setSorting().

◆ $value

string ilDclSelectionOption::$value
protected

Definition at line 72 of file class.ilDclSelectionOption.php.

Referenced by getValue(), and setValue().

◆ DB_TABLE_NAME

const ilDclSelectionOption::DB_TABLE_NAME = "il_dcl_sel_opts"

Definition at line 23 of file class.ilDclSelectionOption.php.

Referenced by returnDbTableName().


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