当前位置: 首页>>代码示例>>PHP>>正文


PHP CCrmOwnerType::ResolveUserFieldEntityID方法代码示例

本文整理汇总了PHP中CCrmOwnerType::ResolveUserFieldEntityID方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmOwnerType::ResolveUserFieldEntityID方法的具体用法?PHP CCrmOwnerType::ResolveUserFieldEntityID怎么用?PHP CCrmOwnerType::ResolveUserFieldEntityID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCrmOwnerType的用法示例。


在下文中一共展示了CCrmOwnerType::ResolveUserFieldEntityID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUserFields

 public static function getUserFields($entityTypeID)
 {
     if (self::$userFields !== null && isset(self::$userFields[$entityTypeID])) {
         return self::$userFields[$entityTypeID];
     }
     if (self::$userFields !== null) {
         self::$userFields = array();
     }
     /** @var \CAllUserTypeManager $USER_FIELD_MANAGER */
     global $USER_FIELD_MANAGER;
     self::$userFields[$entityTypeID] = $USER_FIELD_MANAGER->GetUserFields(\CCrmOwnerType::ResolveUserFieldEntityID($entityTypeID));
     return self::$userFields[$entityTypeID];
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:entityconversionmapper.php

示例2: getIntersection

 /**
  * Compares source type fields with destination type fields.
  * Matches are searched by comparing field labels.
  * @static
  * @param int $srcEntityTypeID Source Entity Type ID
  * @param int $dstEntityTypeID Destination Entity Type ID
  * @param string $languageID Language
  * @return Array
  */
 public static function getIntersection($srcEntityTypeID, $dstEntityTypeID, $languageID = '')
 {
     if (!is_string($languageID) || $languageID === '') {
         $languageID = LANGUAGE_ID;
     }
     $srcUfEntityID = \CCrmOwnerType::ResolveUserFieldEntityID($srcEntityTypeID);
     $dstUfEntityID = \CCrmOwnerType::ResolveUserFieldEntityID($dstEntityTypeID);
     /** @var \CAllUserTypeManager $USER_FIELD_MANAGER */
     global $USER_FIELD_MANAGER;
     /** @var \CAllMain $APPLICATION */
     global $APPLICATION;
     $srcFields = $USER_FIELD_MANAGER->GetUserFields($srcUfEntityID, 0, $languageID);
     $dstFields = $USER_FIELD_MANAGER->GetUserFields($dstUfEntityID, 0, $languageID);
     $map = array();
     foreach ($dstFields as $field) {
         $label = self::getFieldComplianceCode($field);
         if ($label === '') {
             continue;
         }
         $typeID = $field['USER_TYPE_ID'];
         if (!isset($map[$typeID])) {
             $map[$typeID] = array();
         }
         if (!isset($map[$typeID][$label])) {
             $map[$typeID][$label] = array('NAME' => $field['FIELD_NAME'], 'IS_BUSY' => false);
         }
     }
     $results = array();
     foreach ($srcFields as $field) {
         $label = self::getFieldComplianceCode($field);
         if ($label === '') {
             continue;
         }
         if (isset($results[$label])) {
             continue;
         }
         $typeID = $field['USER_TYPE_ID'];
         if (isset($map[$typeID]) && isset($map[$typeID][$label]) && !$map[$typeID][$label]['IS_BUSY']) {
             $results[$label] = array('LABEL' => $label, 'SRC_FIELD_NAME' => $field['FIELD_NAME'], 'DST_FIELD_NAME' => $map[$typeID][$label]['NAME']);
             $map[$typeID][$label]['IS_BUSY'] = true;
         }
     }
     return $results;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:53,代码来源:userfieldsynchronizer.php

示例3: __construct

 function __construct($ownerTypeID, \CUser $user = null)
 {
     $this->ownerTypeID = CCrmOwnerType::IsDefined($ownerTypeID) ? $ownerTypeID : CCrmOwnerType::Undefined;
     parent::__construct(CCrmOwnerType::ResolveUserFieldEntityID($this->ownerTypeID), $user);
     $this->setNamePrefix('crm');
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:6,代码来源:restservice.php

示例4: WriteFileToResponse

 public static function WriteFileToResponse($ownerTypeID, $ownerID, $fieldName, $fileID, &$errors, $options = array())
 {
     $ownerTypeID = intval($ownerTypeID);
     $ownerTypeName = CCrmOwnerType::ResolveName($ownerTypeID);
     $ownerID = intval($ownerID);
     $fieldName = strval($fieldName);
     $fileID = intval($fileID);
     $options = is_array($options) ? $options : array();
     if (!CCrmOwnerType::IsDefined($ownerTypeID) || $ownerID <= 0 || $fieldName === '' || $fileID <= 0) {
         $errors[] = 'File not found';
         return false;
     }
     $authToken = isset($options['oauth_token']) ? strval($options['oauth_token']) : '';
     if ($authToken !== '') {
         $authData = array();
         if (!(CModule::IncludeModule('rest') && CRestUtil::checkAuth($authToken, CCrmRestService::SCOPE_NAME, $authData) && CRestUtil::makeAuth($authData))) {
             $errors[] = 'Access denied.';
             return false;
         }
     }
     if (!CCrmPerms::IsAdmin()) {
         $userPermissions = CCrmPerms::GetCurrentUserPermissions();
         $attrs = $userPermissions->GetEntityAttr($ownerTypeName, $ownerID);
         if ($userPermissions->HavePerm($ownerTypeName, BX_CRM_PERM_NONE, 'READ') || !$userPermissions->CheckEnityAccess($ownerTypeName, 'READ', isset($attrs[$ownerID]) ? $attrs[$ownerID] : array())) {
             $errors[] = 'Access denied.';
             return false;
         }
     }
     $isDynamic = isset($options['is_dynamic']) ? (bool) $options['is_dynamic'] : true;
     if ($isDynamic) {
         $userFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields(CCrmOwnerType::ResolveUserFieldEntityID($ownerTypeID), $ownerID, LANGUAGE_ID);
         $field = is_array($userFields) && isset($userFields[$fieldName]) ? $userFields[$fieldName] : null;
         if (!(is_array($field) && $field['USER_TYPE_ID'] === 'file')) {
             $errors[] = 'File not found';
             return false;
         }
         $fileIDs = isset($field['VALUE']) ? is_array($field['VALUE']) ? $field['VALUE'] : array($field['VALUE']) : array();
         //The 'strict' flag must be 'false'. In MULTIPLE mode value is an array of integers. In SIGLE mode value is a string.
         if (!in_array($fileID, $fileIDs, false)) {
             $errors[] = 'File not found';
             return false;
         }
         return self::InnerWriteFileToResponse($fileID, $errors, $options);
     } else {
         $fieldsInfo = isset($options['fields_info']) ? $options['fields_info'] : null;
         if (!is_array($fieldsInfo)) {
             $fieldsInfo = CCrmOwnerType::GetFieldsInfo($ownerTypeID);
         }
         $fieldInfo = is_array($fieldsInfo) && isset($fieldsInfo[$fieldName]) ? $fieldsInfo[$fieldName] : array();
         $fieldInfoType = isset($fieldInfo['TYPE']) ? $fieldInfo['TYPE'] : '';
         if ($fieldInfoType !== 'file') {
             $errors[] = 'File not found';
             return false;
         }
         if ($fileID !== CCrmOwnerType::GetFieldIntValue($ownerTypeID, $ownerID, $fieldName)) {
             $errors[] = 'File not found';
             return false;
         }
         return self::InnerWriteFileToResponse($fileID, $errors, $options);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:61,代码来源:file_proxy.php


注:本文中的CCrmOwnerType::ResolveUserFieldEntityID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。