/** * Создает атрибут из массива с настройками * @param array $settings * @return \bxar\IAttribute */ public function createAttributeFromSettings(array $settings) { if ($settings['code'] !== 'iblock_id') { $uf = $this->getUserFieldsDescription(); } if (isset($uf[$settings['code']]) && $uf[$settings['code']]['USER_TYPE_ID'] === 'enumeration') { $settings['type'] = $uf[$settings['code']]['USER_TYPE_ID']; $settings['params'] = $uf[$settings['code']]; } elseif ($settings['code'] == 'id' || $settings['code'] == 'iblock_id' || $settings['code'] == 'sort' || $settings['code'] == 'left_margin' || $settings['code'] == 'right_margin' || $settings['code'] == 'depth_level') { $settings['type'] = 'numeric'; } elseif ($settings['code'] == 'date_create') { $settings['type'] = 'date'; } elseif ($settings['code'] == 'active' || $settings['code'] == 'global_active') { $settings['type'] = 'bitrixBool'; } elseif ($settings['code'] == 'picture' || $settings['code'] == 'detail_picture') { $settings['type'] = 'file'; } elseif ($settings['code'] == 'iblock_section_id') { $settings['type'] = 'numeric'; } return Factory::create($settings); }
/** * Создает атрибут из массива с настройками * @param array $settings * @return \bxar\IAttribute */ public function createAttributeFromSettings(array $settings) { if ($settings['code'] == 'id') { $settings['type'] = 'numeric'; } elseif ($settings['code'] == 'timestamp_x' || $settings['code'] == 'last_login' || $settings['code'] == 'date_register' || $settings['code'] == 'personal_birthdate') { $settings['type'] = 'date'; } elseif ($settings['code'] == 'active') { $settings['type'] = 'bitrixBool'; } elseif ($settings['code'] == 'personal_photo') { $settings['type'] = 'file'; } return Factory::create($settings); }
/** * Создает атрибут из массива с настройками * @param array $settings * @return \bxar\IAttribute */ public function createAttributeFromSettings(array $settings) { if ($settings['code'] == 'id') { $settings['type'] = 'numeric'; } elseif ($settings['code'] == 'timestamp_x') { $settings['type'] = 'date'; } elseif ($settings['code'] == 'active') { $settings['type'] = 'bitrixBool'; } return Factory::create($settings); }
/** * Создает атрибут из массива с настройками * @param array $settings * @return \bxar\IAttribute */ public function createAttributeFromSettings(array $settings) { if (isset($settings['params']['MULTIPLE']) && $settings['params']['MULTIPLE'] == 'Y') { $settings['type'] = 'multiple'; } elseif ($settings['code'] === 'id' || $settings['code'] === 'iblock_id' || $settings['code'] === 'sort' || isset($settings['params']['PROPERTY_TYPE']) && $settings['params']['PROPERTY_TYPE'] == 'N') { $settings['type'] = 'numeric'; } elseif ($settings['code'] === 'date_active_from' || $settings['code'] === 'date_active_to' || $settings['code'] === 'date_create' || $settings['code'] === 'timestamp_x' || isset($settings['params']['USER_TYPE']) && $settings['params']['USER_TYPE'] == 'DateTime') { $settings['type'] = 'date'; } elseif (isset($settings['params']['USER_TYPE']) && $settings['params']['USER_TYPE'] == 'HTML') { $settings['type'] = 'html'; } elseif ($settings['code'] === 'active') { $settings['type'] = 'bitrixBool'; } elseif (isset($settings['params']['PROPERTY_TYPE']) && $settings['params']['PROPERTY_TYPE'] == 'L') { $settings['type'] = 'list'; } elseif ($settings['code'] === 'preview_picture' || $settings['code'] === 'detail_picture' || isset($settings['params']['PROPERTY_TYPE']) && $settings['params']['PROPERTY_TYPE'] == 'F') { $settings['type'] = 'file'; } elseif ($settings['code'] === 'iblock_section_id') { $settings['type'] = 'bitrixSection'; } elseif ($settings['code'] === 'detail_page_url' || $settings['code'] === 'list_page_url') { $settings['type'] = 'bitrixUrl'; } return Factory::create($settings); }
/** * Создает атрибут из массива с настройками * @param array $settings * @return \bxar\IAttribute */ public function createAttributeFromSettings(array $settings) { if ($settings['params']['USER_TYPE_ID'] == 'integer') { $settings['type'] = 'numeric'; } return Factory::create($settings); }