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


PHP CUserTypeEntity::GetByID方法代码示例

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


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

示例1: generateAddCode

 /**
  * Генерация создания
  *
  * generateAddCode
  * @param array $hlBlockId
  * @return string
  * @throws \Exception
  */
 public function generateAddCode($hlBlockId)
 {
     $return = array();
     $hlBlock = HL\HighloadBlockTable::getById($hlBlockId)->fetch();
     if (!$hlBlock) {
         throw new BimException('Not found highload block with id = ' . $hlBlockId);
     }
     $return[] = $this->getMethodContent('Bim\\Db\\Iblock\\HighloadblockIntegrate', 'Add', array($hlBlock['NAME'], $hlBlock['TABLE_NAME']));
     $hlQuery = $this->userType->GetList(array(), array("ENTITY_ID" => "HLBLOCK_" . $hlBlockId));
     while ($hlData = $hlQuery->Fetch()) {
         $fullData = $this->userType->GetByID($hlData['ID']);
         unset($fullData['ID']);
         unset($fullData['ENTITY_ID']);
         if (($fullData['USER_TYPE_ID'] == "iblock_element" || $fullData['USER_TYPE_ID'] == "iblock_section") && isset($fullData['SETTINGS']['IBLOCK_ID'])) {
             if (!empty($fullData['SETTINGS']['IBLOCK_ID'])) {
                 $iblockId = $fullData['SETTINGS']['IBLOCK_ID'];
                 unset($fullData['SETTINGS']['IBLOCK_ID']);
                 $blockQuery = $this->iblock->GetList(array(), array('ID' => $iblockId, 'CHECK_PERMISSIONS' => 'N'));
                 if ($iBlockData = $blockQuery->Fetch()) {
                     $fullData['SETTINGS']['IBLOCK_CODE'] = $iBlockData['CODE'];
                 } else {
                     throw new BimException(' Not found iblock with id ' . $iblockId);
                 }
             }
         }
         $return[] = $this->getMethodContent('Bim\\Db\\Iblock\\HighloadblockFieldIntegrate', 'Add', array($hlBlock['NAME'], $fullData));
     }
     return implode(PHP_EOL, $return);
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:37,代码来源:Hlblock.php

示例2: checkParams

 /**
  * Абстрактный метод проверки передаваемых параметров
  *
  * checkParams
  * @param array $params
  * @return mixed|void
  * @throws \Exception
  */
 public function checkParams($params)
 {
     if (!isset($params['hlblockId']) || empty($params['hlblockId'])) {
         throw new BimException('В параметрах не найден hlblockId');
     }
     if (!isset($params['hlFieldId']) || empty($params['hlFieldId'])) {
         throw new BimException('В параметрах не найден hlFieldId');
     }
     $hlBlock = HL\HighloadBlockTable::getById($params['hlblockId'])->fetch();
     if (!$hlBlock) {
         throw new BimException('В системе не найден highload инфоблок с id = ' . $params['hlblockId']);
     }
     $this->ownerItemDbData['hlblockData'] = $hlBlock;
     if ($params['hlFieldId']) {
         $userFieldData = $this->userType->GetByID($params['hlFieldId']);
         if ($userFieldData === false || empty($userFieldData)) {
             throw new BimException('Не найдено пользовательское поле с id = ' . $params['hlFieldId']);
         }
         $this->ownerItemDbData['hlFieldData'] = $userFieldData;
     }
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:29,代码来源:HlblockField.php

示例3: GetRights

	function GetRights($ENTITY_ID=false, $ID=false)
	{
		if(($ID !== false) && array_key_exists("ID:".$ID, $this->arRightsCache))
		{
			return $this->arRightsCache["ID:".$ID];
		}
		if(($ENTITY_ID !== false) && array_key_exists("ENTITY_ID:".$ENTITY_ID, $this->arRightsCache))
		{
			return $this->arRightsCache["ENTITY_ID:".$ENTITY_ID];
		}

		global $USER;
		if(is_object($USER) && $USER->CanDoOperation('edit_other_settings'))
		{
			$RIGHTS = "X";
		}
		else
		{
			$RIGHTS = "D";
			if($ID !== false)
			{
				$ar = CUserTypeEntity::GetByID($ID);
				if($ar)
					$ENTITY_ID = $ar["ENTITY_ID"];
			}

			foreach(GetModuleEvents("main", "OnUserTypeRightsCheck", true) as $arEvent)
			{
				$res = ExecuteModuleEventEx($arEvent, array($ENTITY_ID));
				if($res > $RIGHTS)
					$RIGHTS = $res;
			}
		}

		if($ID !== false)
		{
			$this->arRightsCache["ID:".$ID] = $RIGHTS;
		}
		if($ENTITY_ID !== false)
		{
			$this->arRightsCache["ENTITY_ID:".$ENTITY_ID] = $RIGHTS;
		}

		return $RIGHTS;
	}
开发者ID:nycmic,项目名称:bittest,代码行数:45,代码来源:usertype.php

示例4: LocalRedirect

        if ($apply != "") {
            LocalRedirect("/bitrix/admin/userfield_edit.php?ID=" . $ID . "&lang=" . LANG . "&back_url=" . urlencode($back_url) . "&" . $tabControl->ActiveTabParam());
        } elseif ($back_url) {
            LocalRedirect($back_url);
        } else {
            LocalRedirect("/bitrix/admin/userfield_admin.php?lang=" . LANG);
        }
    } else {
        if ($e = $APPLICATION->GetException()) {
            $message = new CAdminMessage(GetMessage("USER_TYPE_SAVE_ERROR"), $e);
        }
        $bVarsFromForm = true;
    }
}
if ($ID > 0) {
    $arUserField = CUserTypeEntity::GetByID($ID);
    if (!$arUserField) {
        $ID = 0;
    }
} else {
    $arUserField = array("ENTITY_ID" => isset($_GET["ENTITY_ID"]) ? $_GET["ENTITY_ID"] : "", "FIELD_NAME" => isset($_GET["FIELD_NAME"]) ? $_GET["FIELD_NAME"] : "UF_", "USER_TYPE_ID" => isset($_GET["USER_TYPE_ID"]) ? $_GET["USER_TYPE_ID"] : "", "XML_ID" => "", "SORT" => 100, "MULTIPLE" => "N", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "Y", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "N", "SETTINGS" => array());
}
if ($bVarsFromForm) {
    $ENTITY_ID = htmlspecialcharsbx($_REQUEST["ENTITY_ID"]);
    $FIELD_NAME = htmlspecialcharsbx($_REQUEST["FIELD_NAME"]);
    $USER_TYPE_ID = htmlspecialcharsbx($_REQUEST["USER_TYPE_ID"]);
    $XML_ID = htmlspecialcharsbx($_REQUEST["XML_ID"]);
    $SORT = htmlspecialcharsbx($_REQUEST["SORT"]);
    $MULTIPLE = htmlspecialcharsbx($_REQUEST["MULTIPLE"]);
    $MANDATORY = htmlspecialcharsbx($_REQUEST["MANDATORY"]);
    $SHOW_FILTER = htmlspecialcharsbx($_REQUEST["SHOW_FILTER"]);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:userfield_edit.php

示例5: genHlblockFieldDelete

 /**
  * genHlblockFieldDelete
  * @param array $args
  * @param array $options
  */
 public function genHlblockFieldDelete(array $args, array $options = array())
 {
     $dialog = new \ConsoleKit\Widgets\Dialog($this->console);
     $hlId = isset($options['hlblockid']) ? $options['hlblockid'] : false;
     if (!$hlId) {
         $do = true;
         while ($do) {
             $desk = "Put id Highloadblock - no default/required";
             $hlId = $dialog->ask($desk . PHP_EOL . $this->color('[HLBLOCK_ID]:', \ConsoleKit\Colors::YELLOW), '', false);
             $hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getById($hlId)->fetch();
             if ($hlblock) {
                 $do = false;
             } else {
                 $this->error('Highloadblock with id = "' . $hlId . '" not exist.');
             }
         }
     }
     $hlFieldId = isset($options['hlFieldId']) ? $options['hlFieldId'] : false;
     if (!$hlFieldId) {
         $do = true;
         while ($do) {
             $desk = "Put id HighloadblockField (UserField) - no default/required";
             $hlFieldId = $dialog->ask($desk . PHP_EOL . $this->color('[USER_FIELD_ID]:', \ConsoleKit\Colors::YELLOW), '', false);
             $userFieldData = \CUserTypeEntity::GetByID($hlFieldId);
             if ($userFieldData === false || empty($userFieldData)) {
                 $this->error('UserField with id = "' . $hlFieldId . '" not exist.');
             } else {
                 $do = false;
             }
         }
     }
     # get description options
     $desc = isset($options['d']) ? $options['d'] : "";
     # set
     $autoTag = "delete";
     $this->_save($this->generateObject->generateDeleteCode(array("hlblockId" => $hlId, "hlFieldId" => $hlFieldId)), $this->generateObject->generateAddCode(array("hlblockId" => $hlId, "hlFieldId" => $hlFieldId)), $desc, $autoTag);
 }
开发者ID:cjp2600,项目名称:bim-core,代码行数:42,代码来源:GenCommand.php

示例6: ShowError

    ShowError($ex->GetString());
    return;
}
$arResult['DISABLE_MULTIPLE'] = false;
$arResult['NEW_FIELD'] = false;
if (!$arResult['FIELD_ID']) {
    $arResult['NEW_FIELD'] = true;
}
$arResult['FIELD'] = array();
if (!$arResult['NEW_FIELD'] && !($arResult['FIELD'] = $CCrmFields->GetByName($arResult['FIELD_ID']))) {
    ShowError(GetMessage('CRM_FIELDS_EDIT_WRONG_FIELD'));
    return;
}
if (isset($arResult['FIELD']['ID'])) {
    //HACK: is required for obtain a multilang support for EDIT_FORM_LABEL
    $fieldData = CUserTypeEntity::GetByID($arResult['FIELD']['ID']);
    if ($fieldData) {
        $arResult['FIELD']['EDIT_FORM_LABEL'] = $fieldData['EDIT_FORM_LABEL'];
        $arResult['FIELD']['LIST_COLUMN_LABEL'] = $fieldData['LIST_COLUMN_LABEL'];
        $arResult['FIELD']['LIST_FILTER_LABEL'] = $fieldData['LIST_FILTER_LABEL'];
        $arResult['FIELD']['ERROR_MESSAGE'] = $fieldData['ERROR_MESSAGE'];
        $arResult['FIELD']['HELP_MESSAGE'] = $fieldData['HELP_MESSAGE'];
    }
}
$arResult['GRID_ID'] = 'field_list';
$arResult['FORM_ID'] = 'field_edit';
$arResult['~ENTITY_LIST_URL'] = $arParams['~ENTITY_LIST_URL'];
$arResult['ENTITY_LIST_URL'] = htmlspecialcharsbx($arParams['~ENTITY_LIST_URL']);
$arResult['~FIELDS_LIST_URL'] = str_replace('#entity_id#', $arResult['ENTITY_ID'], $arParams['~FIELDS_LIST_URL']);
$arResult['FIELDS_LIST_URL'] = htmlspecialcharsbx($arResult['~FIELDS_LIST_URL']);
$arResult['~FIELD_EDIT_URL'] = str_replace(array('#entity_id#', '#field_id#'), array($arResult['ENTITY_ID'], $arResult['FIELD_ID']), $arParams['~FIELD_EDIT_URL']);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例7: Validate


//.........这里部分代码省略.........
								$arResult['values'] = array_keys($arCheckResult);
								$arResult['labels'] = array_values($arCheckResult);
							}
							else
							{
								$boolError = true;
								$arMsg[] = GetMessage('BT_MOD_COND_ERR_CHECK_DATA_USER_ABSENT_MULTI');
							}
						}
						else
						{
							$rsUsers = CUser::GetList(($by2 = 'ID'),($order2 = 'ASC'),array('ID_EQUAL_EXACT' => $arOneCondition['value']),array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME')));
							if ($arUser = $rsUsers->Fetch())
							{
								$arResult['values'] = $arOneCondition['value'];
								$arResult['labels'] = trim($arUser['NAME'].' '.$arUser['LAST_NAME']);
								if ('' == $arResult['labels'])
									$arResult['labels'] = $arUser['LOGIN'];
							}
							else
							{
								$boolError = true;
								$arMsg[] = GetMessage('BT_MOD_COND_ERR_CHECK_DATA_USER_ABSENT');
							}
						}
						break;
					case 'user_property':
						if (is_array($arOneCondition['value']))
						{
							$arCheckResult = array();
							foreach ($arOneCondition['value'] as &$intPropID)
							{

								$arProp = CUserTypeEntity::GetByID( $intPropID );
								if (!empty($arProp))
								{
									$strName = trim($arProp['FIELD_NAME']);
									$arCheckResult[$intPropID] = $strName;
								}
							}
							if (isset($intPropID))
								unset($intPropID);
							if (!empty($arCheckResult))
							{
								$arResult['values'] = array_keys($arCheckResult);
								$arResult['labels'] = array_values($arCheckResult);
							}
							else
							{
								$boolError = true;
								$arMsg[] = GetMessage('BT_MOD_COND_ERR_CHECK_DATA_USER_ABSENT_MULTI');
							}
						}
						else
						{
							$arProp = CUserTypeEntity::GetByID( $arOneCondition['value'] );
							if (!empty($arProp))
							{
								$arResult['values'] = $arOneCondition['value'];
								$arResult['labels'] = trim($arProp['FIELD_NAME']);
							}
							else
							{
								$boolError = true;
								$arMsg[] = GetMessage('BT_MOD_COND_ERR_CHECK_DATA_USER_ABSENT');
							}
开发者ID:ASDAFF,项目名称:trigger-module,代码行数:67,代码来源:conditions.php

示例8: prepareX

    private function prepareX($x) {
        global $APPLICATION;
        $x['features'] = $x['features']['TEXT'];
        foreach ($x['photos'] as $key => $photo) {
            $x['fancybox'][$key] = array(
                'thumb' => array(
                    'medium' => CFile::ResizeImageGet($photo, array("width" => 370, "height" => 250 ), BX_RESIZE_IMAGE_EXACT, false),
                    'small' => CFile::ResizeImageGet($photo, array("width" => 80, "height" => 50 ), BX_RESIZE_IMAGE_EXACT, false),
                    ),
                'normal' => [
                    'src' => CFile::GetPath($photo)
                    ]
                );
        }
        $x['section'] = CIBlockSection::GetList(false, [
            'IBLOCK_ID' => self::IBLOCK_ID,
            'ACTIVE' => 'Y',
            'CODE' => $this->arParams['SECTION_CODE']
            ], false, [
            'NAME', 'CODE', 'SECTION_PAGE_URL', 'UF_*'
            ])->GetNext();
        $obUserTypeEntity = new CUserTypeEntity;
        foreach ($x['section'] as $key => $info) {
            if (strpos($key, 'UF_') !== false && strpos($key, '~') === false && strpos($key, 'NO_PHOTO') === false && $info) {
                $x['section']['properties'][$key] = [
                    'name' => CUserTypeEntity::GetByID($obUserTypeEntity->GetList(array(), array("FIELD_NAME" => $key))->Fetch()['ID'])['LIST_COLUMN_LABEL']['ru'],
                    'value' => $info
                ];
            } 
        }
        $x['section']['no_photo'] = CFile::GetPath($x['section']['UF_NO_PHOTO']);
        $x['make'] = CIBlockSection::GetList(false, [
            'ID' => $x['make']
            ], false, [
            'NAME', 'CODE'
            ])->Fetch();

        $x['model'] = CIBlockSection::GetList(false, [
            'ID' => $x['model']
            ], false, [
            'NAME', 'CODE'
            ])->Fetch();
        $APPLICATION->AddChainItem($x['section']['NAME'], $x['section']['SECTION_PAGE_URL']);
        $APPLICATION->AddChainItem($x['name'], '');        
        return $x;
    }
开发者ID:ASDAFF,项目名称:stex,代码行数:46,代码来源:class.php

示例9: synchronize

 /**
  * Synchronize source type fields with destination type fields.
  * Matches are searched by comparing field labels.
  * If a source field is not found in the destination type, it will be created there.
  * @static
  * @param int $srcEntityTypeID Source Entity Type ID
  * @param int $dstEntityTypeID Destination Entity Type ID
  * @param string $languageID Language
  * @return void
  */
 public static function synchronize($srcEntityTypeID, $dstEntityTypeID, $languageID = '')
 {
     /** @var \CAllMain $APPLICATION */
     global $APPLICATION;
     $entity = new \CUserTypeEntity();
     $entityID = \CCrmOwnerType::ResolveUserFieldEntityID($dstEntityTypeID);
     $fields = self::getSynchronizationFields($srcEntityTypeID, $dstEntityTypeID, $languageID, true);
     foreach ($fields as $field) {
         $srcField = $entity->GetByID($field['ID']);
         if (!is_array($srcField)) {
             continue;
         }
         $typeID = $srcField['USER_TYPE_ID'];
         do {
             $fieldName = 'UF_CRM_' . strtoupper(uniqid());
             $dbResult = $entity->GetList(array(), array('ENTITY_ID' => $entityID, 'FIELD_NAME' => $fieldName));
         } while (is_array($dbResult->Fetch()));
         $dstField = array('FIELD_NAME' => $fieldName, 'ENTITY_ID' => $entityID, 'USER_TYPE_ID' => $typeID, 'SORT' => isset($srcField['SORT']) ? $srcField['SORT'] : 100, 'MULTIPLE' => isset($srcField['MULTIPLE']) ? $srcField['MULTIPLE'] : 'N', 'MANDATORY' => isset($srcField['MANDATORY']) ? $srcField['MANDATORY'] : 'N', 'SHOW_FILTER' => isset($srcField['SHOW_FILTER']) ? $srcField['SHOW_FILTER'] : 'N', 'SHOW_IN_LIST' => isset($srcField['SHOW_IN_LIST']) ? $srcField['SHOW_IN_LIST'] : 'N');
         if (isset($srcField['SETTINGS'])) {
             $dstField['SETTINGS'] = $srcField['SETTINGS'];
         }
         if (isset($srcField['EDIT_FORM_LABEL'])) {
             $dstField['EDIT_FORM_LABEL'] = $srcField['EDIT_FORM_LABEL'];
         }
         if (isset($srcField['LIST_COLUMN_LABEL'])) {
             $dstField['LIST_COLUMN_LABEL'] = $srcField['LIST_COLUMN_LABEL'];
         }
         if (isset($srcField['LIST_FILTER_LABEL'])) {
             $dstField['LIST_FILTER_LABEL'] = $srcField['LIST_FILTER_LABEL'];
         }
         $ID = $entity->Add($dstField);
         if ($ID === false) {
             throw new UserFieldSynchronizationException($dstField, $APPLICATION->GetException(), UserFieldSynchronizationException::CREATE_FAILED, __FILE__, __LINE__);
         }
         if ($typeID === 'enumeration') {
             if (is_callable(array($field['USER_TYPE']['CLASS_NAME'], 'GetList'))) {
                 $enumList = array();
                 $enumQty = 0;
                 $enumResult = call_user_func_array(array($field['USER_TYPE']['CLASS_NAME'], 'GetList'), array($field));
                 while ($enum = $enumResult->GetNext()) {
                     unset($enum['ID']);
                     $enumList["n{$enumQty}"] = $enum;
                     $enumQty++;
                 }
                 $enumEntity = new \CUserFieldEnum();
                 $enumEntity->SetEnumValues($ID, $enumList);
             }
         }
     }
     $historyItem = self::getHistoryItem($srcEntityTypeID, $dstEntityTypeID);
     if ($historyItem === null) {
         $historyItem = array();
     }
     $historyItem['sync'] = new DateTime();
     $historyItem['check'] = new DateTime();
     $historyItem['required'] = false;
     self::setHistoryItem($srcEntityTypeID, $dstEntityTypeID, $historyItem);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:68,代码来源:userfieldsynchronizer.php

示例10: define

<?
define("STOP_STATISTICS", true);
define("BX_SECURITY_SHOW_MESSAGE", true);

require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
__IncludeLang(dirname(__FILE__)."/lang/".LANGUAGE_ID."/".basename(__FILE__));

global $APPLICATION, $USER_FIELD_MANAGER;

CUtil::JSPostUnescape();

$arUserField = CUserTypeEntity::GetByID(intval($_REQUEST["PID"]));
if(!$arUserField)
{
	echo "incorrect usertype";
	die();
}
$arUserType = $USER_FIELD_MANAGER->GetUserType($arUserField["USER_TYPE_ID"]);

$strBanSym = trim($arUserField["SETTINGS"]["BAN_SYM"]);
$arBanSym = str_split($strBanSym, 1);
$strRepSym = trim($arUserField["SETTINGS"]["REP_SYM"]);

$arRepSym = array_fill(0, sizeof($arBanSym), $strRepSym);

if($_REQUEST["MODE"] == "SEARCH")
{
	$APPLICATION->RestartBuffer();

	$arResult = array();
	$search = trim($_REQUEST["search"]);
开发者ID:alexshipil,项目名称:bitrix.simple.module,代码行数:31,代码来源:ajax.php


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