ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclTableFieldSetting.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
33 protected ?int $id;
41 protected int $table_id;
49 protected string $field;
56 protected int $field_order = 0;
63 protected bool $exportable = false;
64
68 public static function returnDbTableName(): string
69 {
70 return "il_dcl_tfield_set";
71 }
72
73 public function getId(): int
74 {
75 return $this->id;
76 }
77
78 public function setId(int $id): void
79 {
80 $this->id = $id;
81 }
82
83 public function getTableId(): int
84 {
85 return $this->table_id;
86 }
87
88 public function setTableId(int $table_id): void
89 {
90 $this->table_id = $table_id;
91 }
92
93 public function getField(): string
94 {
95 return $this->field;
96 }
97
98 public function setField(string $field): void
99 {
100 $this->field = $field;
101 }
102
103 public function getFieldOrder(): int
104 {
105 return $this->field_order;
106 }
107
108 public function setFieldOrder(int $field_order): void
109 {
110 $this->field_order = $field_order;
111 }
112
113 public function isExportable(): bool
114 {
115 return $this->exportable;
116 }
117
118 public function setExportable(bool $exportable): void
119 {
120 $this->exportable = $exportable;
121 }
122
126 public static function getInstance(int $table_id, string $field): ActiveRecord
127 {
128 $setting = self::where(['table_id' => $table_id, 'field' => $field])->first();
129 if (!$setting) {
130 $setting = new self();
131 $setting->setField($field);
132 $setting->setTableId($table_id);
133 }
134
135 return $setting;
136 }
137}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static where($where, $operator=null)
static getInstance(int $table_id, string $field)
static returnDbTableName()
@description Return the Name of your Database Table