30 protected static array
$prefixes = array(
'db',
'con');
53 protected \ActiveRecord
$ar;
55 self::FIELDTYPE =>
'type',
56 self::IS_NOTNULL =>
'notnull',
69 if (isset(self::$key_maps[$key])) {
70 return self::$key_maps[
$key];
79 return self::$allowed_connector_fields;
84 return self::$allowed_description_fields;
89 $arFieldList =
new self(
$ar);
91 $arFieldList->initFields();
101 $arFieldList =
new self(
$ar);
103 $arFieldList->initFields();
113 $return[$field->getName()] = $field->getAttributesForConnector();
125 $this->
fields[] = $arField;
126 if ($arField->getPrimary()) {
137 $field_key = $this->ar->getConnectorContainerName() .
'.' . $field_name;
138 if (is_array($field_map) && array_key_exists($field_key, $field_map)) {
139 return $field_map[$field_key];
142 if ($field->getName() === $field_name) {
143 $field_map[$field_key] = $field;
152 public function isField(
string $field_name): bool
156 if ($field->getName() === $field_name) {
176 $regex =
"/[ ]*\\* @(" . implode(
'|', self::$prefixes) .
")_([a-zA-Z0-9_]*)[ ]*([a-zA-Z0-9_]*)/u";
178 $raw_fields = array();
179 foreach ($reflectionClass->getProperties() as $property) {
180 if (in_array($property->getName(), self::$protected_names)) {
183 $properties_array = array();
184 $has_property =
false;
185 foreach (explode(
"\n", $property->getDocComment()) as $line) {
186 if (preg_match($regex, $line, $matches)) {
187 $has_property =
true;
188 $properties_array[(string) $matches[2]] = $matches[3];
192 $raw_fields[$property->getName()] = $properties_array;
201 return in_array($attribute_name, array_merge(self::$allowed_description_fields, array(self::HAS_FIELD)),
true);
206 if (isset($attributes[self::HAS_FIELD]) && $attributes[self::HAS_FIELD] ===
'true') {
207 foreach (array_keys($attributes) as $atr) {
208 if (!self::isAllowedAttribute($atr)) {
static mapKey(string $key)
static getInstance(ActiveRecord $ar)
static getAllowedConnectorFields()
static isAllowedAttribute(string $attribute_name)
isField(string $field_name)
setPrimaryFields(array $primary_fields)
static array $allowed_connector_fields
setPrimaryField(\arField $primary_field)
static checkAttributes(array $attributes)
setRawFields(array $raw_fields)
static getInstanceFromStorage(\ActiveRecord $ar)
static getAllowedDescriptionFields()
static array $allowed_description_fields
getFieldByName(string $field_name)
__construct(ActiveRecord $ar)
arFieldList constructor.
static array $protected_names
initRawFields(ActiveRecord $ar)