ILIAS  release_8 Revision v8.24
ilDclSelectionOption Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ 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 ($primary_key=0)
 
 storeObjectToCache ()
 
 asStdClass ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $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=array())
 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=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, array $fields=array(' *'), string $operator='=', $both_external=false)
 
static innerjoin ( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
 
static leftjoin ( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
 
static orderBy ($orderBy, string $orderDirection='ASC')
 
static dateFormat (string $date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw (bool $set_raw=true)
 
static getArray (?string $key=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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ cloneOption()

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

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

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

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 136 of file class.ilDclSelectionOption.php.

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

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 146 of file class.ilDclSelectionOption.php.

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

References $field_id, and ActiveRecord\where().

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

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

◆ getFieldId()

ilDclSelectionOption::getFieldId ( )

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

82 : int
83 {
84 return $this->field_id;
85 }

References $field_id.

◆ getId()

ilDclSelectionOption::getId ( )

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

72 : int
73 {
74 return $this->id;
75 }

References $id.

◆ getOptId()

ilDclSelectionOption::getOptId ( )

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

92 : int
93 {
94 return $this->opt_id;
95 }

References $opt_id.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ getSorting()

ilDclSelectionOption::getSorting ( )

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

112 : int
113 {
114 return $this->sorting;
115 }

References $sorting.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ getValue()

ilDclSelectionOption::getValue ( )

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

102 : string
103 {
104 return $this->value;
105 }

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 155 of file class.ilDclSelectionOption.php.

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

References $field_id, and ActiveRecord\orderBy().

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

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

◆ returnDbTableName()

static ilDclSelectionOption::returnDbTableName ( )
static
Exceptions

arException

Deprecated:

Reimplemented from ActiveRecord.

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

23 : string
24 {
26 }

References DB_TABLE_NAME.

◆ setFieldId()

ilDclSelectionOption::setFieldId ( int  $field_id)

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

87 : void
88 {
89 $this->field_id = $field_id;
90 }

References $field_id.

◆ setId()

ilDclSelectionOption::setId ( int  $id)

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

77 : void
78 {
79 $this->id = $id;
80 }

References $id.

◆ setOptId()

ilDclSelectionOption::setOptId ( int  $opt_id)

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

97 : void
98 {
99 $this->opt_id = $opt_id;
100 }

References $opt_id.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ setSorting()

ilDclSelectionOption::setSorting ( int  $sorting)

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

117 : void
118 {
119 $this->sorting = $sorting;
120 }

References $sorting.

Referenced by cloneOption().

+ Here is the caller graph for this function:

◆ setValue()

ilDclSelectionOption::setValue ( string  $value)

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

107 : void
108 {
109 $this->value = $value;
110 }

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 38 of file class.ilDclSelectionOption.php.

Referenced by getId(), and setId().

◆ $opt_id

int ilDclSelectionOption::$opt_id
protected

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

Referenced by getOptId(), and setOptId().

◆ $sorting

int ilDclSelectionOption::$sorting
protected

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

Referenced by getSorting(), and setSorting().

◆ $value

string ilDclSelectionOption::$value
protected

Definition at line 70 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 21 of file class.ilDclSelectionOption.php.

Referenced by returnDbTableName().


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