2 require_once(
'class.arField.php');
69 self::FIELDTYPE =>
'type',
70 self::IS_NOTNULL =>
'notnull',
79 public static function mapKey($key) {
80 if (isset(self::$key_maps[$key])) {
81 return self::$key_maps[$key];
92 return self::$allowed_connector_fields;
100 return self::$allowed_description_fields;
110 $arFieldList =
new self();
111 $arFieldList->initRawFields($ar);
112 $arFieldList->initFields();
125 $arFieldList =
new self();
126 $arFieldList->initRawFields($ar);
127 $arFieldList->initFields();
139 $return[$field->getName()] = $field->getAttributesForConnector();
147 foreach ($this->
getRawFields() as $fieldname => $attributes) {
148 if (self::checkAttributes($attributes)) {
150 $arField->getHasField(
true);
151 $arField->loadFromArray($fieldname, $attributes);
152 $this->
fields[] = $arField;
153 if ($arField->getPrimary()) {
169 if ($field_map[$field_name]) {
170 return $field_map[$field_name];
173 if ($field->getName() == $field_name) {
174 $field_map[$field_name] = $field;
190 if ($field->getName() == $field_name) {
221 $regex =
"/[ ]*\\* @(" . implode(
'|', self::$prefixes) .
")_([a-zA-Z0-9_]*)[ ]*([a-zA-Z0-9_]*)/u";
222 $reflectionClass =
new ReflectionClass($ar);
224 foreach ($reflectionClass->getProperties() as $property) {
225 if (in_array($property->getName(), self::$protected_names)) {
228 $properties_array = array();
229 $has_property =
false;
230 foreach (explode(
"\n", $property->getDocComment()) as $line) {
231 if (preg_match($regex, $line, $matches)) {
232 $has_property =
true;
233 $properties_array[(string)$matches[2]] = $matches[3];
237 $raw_fields[$property->getName()] = $properties_array;
251 return in_array($attribute_name, array_merge(self::$allowed_description_fields, array( self::HAS_FIELD )));
261 if ($attributes[self::HAS_FIELD] ===
'true') {
262 foreach (array_keys($attributes) as $atr) {
263 if (!self::isAllowedAttribute($atr)) {
Class arStorageInterface.
getFieldByName($field_name)
setRawFields($raw_fields)
static getInstance(ActiveRecord $ar)
static $allowed_description_fields
setPrimaryFields($primary_fields)
static getAllowedConnectorFields()
initRawFields(arStorageInterface $ar)
static isAllowedAttribute($attribute_name)
setPrimaryField($primary_field)
static $allowed_connector_fields
static getInstanceFromStorage($ar)
static checkAttributes(array $attributes)
static getAllowedDescriptionFields()