25 return self::DB_TABLE_NAME;
77 public function setId(
int $id): void
122 public static function storeOption(
int $field_id,
int $opt_id,
int $sorting,
string $value):
void 125 $option = self::where(array(
"field_id" => $field_id,
"opt_id" => $opt_id))->first();
127 $option =
new self();
129 $option->setFieldId($field_id);
130 $option->setOptId($opt_id);
131 $option->setSorting($sorting);
132 $option->setValue($value);
138 foreach (self::getAllForField($field_id) as $option) {
148 return self::where(array(
"field_id" => $field_id))->orderBy(
'sorting')->get();
155 public static function getValues(
int $field_id, $opt_ids): array
157 $operators = array(
'field_id' =>
'=');
158 if (is_array($opt_ids)) {
159 if (empty($opt_ids)) {
162 $operators[
'opt_id'] =
'IN';
164 $operators[
'opt_id'] =
'=';
167 foreach (self::where(
168 array(
"field_id" => $field_id,
"opt_id" => $opt_ids),
170 )->
orderBy(
'sorting')->
get() as $opt) {
171 $return[] = $opt->getValue();
cloneOption(ilDclSelectionOption $original_option)
static returnDbTableName()
static orderBy($orderBy, string $orderDirection='ASC')
static getValues(int $field_id, $opt_ids)
static flushOptions(int $field_id)
static getAllForField(int $field_id)
setFieldId(int $field_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...