/** * Получить дополнительные поля профиля пользователя * * @param array|null $aType Типы полей, null - все типы * * @return ModuleUser_EntityField[] */ public function getUserFields($aType = null) { $sCacheKey = 'user_fields'; if (false === ($data = E::ModuleCache()->Get($sCacheKey, 'tmp,'))) { $data = $this->oMapper->getUserFields(); E::ModuleCache()->Set($data, $sCacheKey, array('user_fields_update'), 'P10D', 'tmp,'); } $aResult = array(); if ($data) { if (empty($aType)) { $aResult = $data; } else { if (!is_array($aType)) { $aType = array($aType); } foreach ($data as $oUserField) { if (in_array($oUserField->getType(), $aType)) { $aResult[$oUserField->getId()] = $oUserField; } } } } return $aResult; }
/** * Получить дополнительные поля профиля пользователя * * @param array|null $aType Типы полей, null - все типы * @return array */ public function getUserFields($aType = null) { return $this->oMapper->getUserFields($aType); }