50 protected static array
$key_maps = [self::FIELDTYPE =>
'type', self::IS_NOTNULL =>
'notnull'];
59 public static function mapKey(
string $key): string
61 if (isset(self::$key_maps[$key])) {
62 return self::$key_maps[$key];
73 return self::$allowed_connector_fields;
81 return self::$allowed_description_fields;
86 $self =
new self($activeRecord);
98 $self =
new self($activeRecord);
111 foreach ($this->
getFields() as $arField) {
112 $return[$arField->getName()] = $arField->getAttributesForConnector();
120 foreach ($this->
getRawFields() as $fieldname => $attributes) {
121 if (self::checkAttributes($attributes)) {
123 $arField->loadFromArray($fieldname, $attributes);
124 $this->fields[] = $arField;
125 if ($arField->getPrimary()) {
136 $field_key = $this->activeRecord->getConnectorContainerName() .
'.' . $field_name;
137 if (is_array($field_map) && array_key_exists($field_key, $field_map)) {
138 return $field_map[$field_key];
141 if ($field->getName() === $field_name) {
142 $field_map[$field_key] = $field;
150 public function isField(
string $field_name): bool
153 foreach ($this->
getFields() as $arField) {
154 if ($arField->getName() === $field_name) {
174 $regex =
"/[\t ]*\\* @(" . implode(
'|', self::$prefixes) .
")_([a-zA-Z0-9_]+)[\t ]+([a-zA-Z0-9_]+)/u";
177 foreach ($reflection->getProperties() as $property) {
178 if (in_array($property->getName(), self::$protected_names)) {
181 $properties_array = [];
182 $has_property =
false;
183 foreach (explode(
"\n", $property->getDocComment()) as $line) {
184 if (preg_match($regex, $line, $matches)) {
185 $has_property =
true;
186 $properties_array[$matches[2]] = $matches[3];
190 $raw_fields[$property->getName()] = $properties_array;
199 return in_array($attribute_name, array_merge(self::$allowed_description_fields, [self::HAS_FIELD]),
true);
204 if (isset($attributes[self::HAS_FIELD]) && $attributes[self::HAS_FIELD] ===
'true') {
205 foreach (array_keys($attributes) as $atr) {
206 if (!self::isAllowedAttribute($atr)) {
235 $this->primary_field = $arField;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static mapKey(string $key)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(ActiveRecord $activeRecord)
static getAllowedConnectorFields()
static getInstanceFromStorage(\ActiveRecord $activeRecord)
static isAllowedAttribute(string $attribute_name)
isField(string $field_name)
setPrimaryFields(array $primary_fields)
setPrimaryField(\arField $arField)
__construct(protected ActiveRecord $activeRecord)
arFieldList constructor.
static array $allowed_connector_fields
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static checkAttributes(array $attributes)
setRawFields(array $raw_fields)
arField array $primary_field
static getAllowedDescriptionFields()
static array $allowed_description_fields
getFieldByName(string $field_name)
static array $protected_names
initRawFields(ActiveRecord $ar)