Ejemplo n.º 1
0
 /**
  * Получить дополнительные поля профиля пользователя
  *
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * Получить дополнительные поля профиля пользователя
  *
  * @param array|null $aType Типы полей, null - все типы
  * @return array
  */
 public function getUserFields($aType = null)
 {
     return $this->oMapper->getUserFields($aType);
 }