34 public static function bind($fields)
36 global $USER_FIELD_MANAGER;
38 $eventManager = EventManager::getInstance();
39 $eventManager->registerEventHandlerCompatible(
'main',
'OnUserTypeBuildList',
'rest', __CLASS__, static::getUserTypeId($fields));
41 $USER_FIELD_MANAGER->CleanCache();
42 static::$descriptionCache =
null;
43 \Bitrix\Rest\PlacementTable::clearHandlerCache();
53 global $USER_FIELD_MANAGER;
55 $eventManager = EventManager::getInstance();
56 $eventManager->unRegisterEventHandler(
'main',
'OnUserTypeBuildList',
'rest', __CLASS__, $handlerCode);
58 $USER_FIELD_MANAGER->CleanCache();
59 static::$descriptionCache =
null;
60 \Bitrix\Rest\PlacementTable::clearHandlerCache();
65 if(static::$descriptionCache ===
null)
67 static::$descriptionCache = array();
70 foreach($placementHandlerList as $placementInfo)
72 static::$descriptionCache[static::getUserTypeId($placementInfo)] = array(
73 'USER_TYPE_ID' => static::getUserTypeId($placementInfo),
74 'CLASS_NAME' =>
'\Bitrix\Rest\UserField\Type',
75 'DESCRIPTION' => $placementInfo[
'TITLE'],
76 'BASE_TYPE' => \CUserTypeManager::BASE_TYPE_STRING,
77 'VIEW_CALLBACK' => array(
'\Bitrix\Rest\UserField\Type',
'getPublicView'),
78 'EDIT_CALLBACK' => array(
'\Bitrix\Rest\UserField\Type',
'getPublicEdit'),
83 return array_key_exists($placementHandlerCode, static::$descriptionCache)
84 ? static::$descriptionCache[$placementHandlerCode]