Exemple #1
0
 /**
  * Возвращает список полей для сущности
  * @param string $entity
  * @return array
  */
 public function getFields($entity)
 {
     $return = null;
     $hlblock = self::getEntityByName($entity);
     if (!empty($hlblock['ID'])) {
         $return = \bxar\helpers\Uf::getListFor("HLBLOCK_{$hlblock['ID']}");
     }
     return $return;
 }
Exemple #2
0
 /**
  * Возвращает список пользовательских полей
  * @return array
  */
 protected function getUserFields()
 {
     $select = \bxar\user\User::getBuiltFields();
     $description = \bxar\helpers\Uf::getListFor('USER');
     foreach ($description as $descr) {
         $select[] = $descr['FIELD_NAME'];
     }
     return $select;
 }
Exemple #3
0
 /**
  * Возвращает описание пользовательских полей
  * @return array
  */
 protected function getUserFieldsDescription()
 {
     $uf = \bxar\helpers\Uf::getListFor('IBLOCK_' . $this->iblock_id->value . '_SECTION');
     $return = [];
     foreach ($uf as $f) {
         $return[$this->prepareAttributeName($f['FIELD_NAME'])] = $f;
     }
     return $return;
 }
Exemple #4
0
 /**
  * Возвращает описание пользовательских полей
  * @return array
  */
 protected function getUserFieldsDescription()
 {
     return \bxar\helpers\Uf::getListFor('USER');
 }
Exemple #5
0
 /**
  * Возвращает все значения списка для указанного свойства
  * @return array
  */
 public function getListItems()
 {
     $return = array();
     $id = $this->getParam('ID');
     $return = \bxar\helpers\Uf::getUserFieldEnum($id);
     return $return;
 }
Exemple #6
0
 /**
  * Запрашиваем данные из базы
  * @return array
  */
 protected function getList()
 {
     $return = array();
     if (!\CModule::IncludeModule('iblock')) {
         return $return;
     }
     //сортировка
     $order = $this->getOrder();
     //условия для поиска
     $filter = $this->getFilter();
     //ограничение количества и смещение
     $nav = array();
     if ($this->getLimit()) {
         if ($this->getOffset() !== null) {
             $nav['nPageSize'] = $this->getLimit();
             $nav['iNumPage'] = ceil($this->getOffset() / $this->getLimit()) + 1;
             $nav['bShowAll'] = false;
         } else {
             $nav['nTopCount'] = $this->getLimit();
         }
     }
     //поля для выборки
     $select = Section::getBuiltFields();
     //пользовательские поля раздела
     $uf = \bxar\helpers\Uf::getListFor('IBLOCK_' . $filter['IBLOCK_ID'] . '_SECTION');
     foreach ($uf as $field) {
         $select[] = $field['FIELD_NAME'];
     }
     //запрос
     $rsElement = \CIBlockSection::GetList($order, $filter, $this->getBIncCnt(), $select, !empty($nav) ? $nav : false);
     while ($obElement = $rsElement->GetNext()) {
         $arItem = array();
         foreach ($obElement as $key => $value) {
             if (strpos($key, '~') !== 0) {
                 continue;
             }
             $arItem[str_replace('~', '', $key)] = $value;
         }
         $return[] = $arItem;
     }
     return $return;
 }