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


PHP CDBResult::InitFromArray方法代码示例

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


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

示例1: getData

 /** @return \CDBResult */
 public function getData()
 {
     $iblockId = $this->getFieldValue('IBLOCK', null);
     $propertyNameId = $this->getFieldValue('PROPERTY_NAME', null);
     $propertyEmailId = $this->getFieldValue('PROPERTY_EMAIL', null);
     if ($iblockId && $propertyEmailId) {
         // if property is property with code like '123'
         $propertyNameValue = null;
         $propertyEmailValue = null;
         if (is_numeric($propertyEmailId)) {
             $propertyEmailId = "PROPERTY_" . $propertyEmailId;
             $propertyEmailValue = $propertyEmailId . "_VALUE";
         }
         $selectFields = array($propertyEmailValue);
         if ($propertyNameId) {
             if (is_numeric($propertyNameId)) {
                 $propertyNameId = "PROPERTY_" . $propertyNameId;
                 $propertyNameValue = $propertyNameId . "_VALUE";
             }
             $selectFields[] = $propertyNameValue;
         }
         $filter = array('IBLOCK_ID' => $iblockId, '!' . $propertyEmailId => false);
         $iblockElementListDb = \CIBlockElement::getList(array('id' => 'asc'), $filter, false, false, $selectFields);
         // replace property names from PROPERTY_123_VALUE to EMAIL, NAME
         $iblockElementDb = new CDBResultSenderConnector($iblockElementListDb);
         $iblockElementDb->senderConnectorFieldEmail = $propertyEmailValue;
         $iblockElementDb->senderConnectorFieldName = $propertyNameValue;
     } else {
         $iblockElementDb = new \CDBResult();
         $iblockElementDb->InitFromArray(array());
     }
     return $iblockElementDb;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:34,代码来源:senderconnector.php

示例2: getData

 /** @return \CDBResult */
 public function getData()
 {
     $formId = $this->getFieldValue('FORM', null);
     $propertyNameId = $this->getFieldValue('PROPERTY_NAME', null);
     $propertyEmailId = $this->getFieldValue('PROPERTY_EMAIL', null);
     $formResultsDb = new \CDBResult();
     if ($formId && $propertyEmailId) {
         $dataResult = array();
         $filter = array();
         $formResultDb = \CFormResult::GetList($formId, $by = "s_timestamp", $order = "asc", $filter, $filtered, "N");
         while ($formResult = $formResultDb->Fetch()) {
             $answerList = \CFormResult::GetDataByID($formResult['ID'], array(), $formResult, $answerList2);
             $data = array();
             foreach ($answerList as $fieldCode => $arFieldsAnswer) {
                 if ($arFieldsAnswer[0]['TITLE_TYPE'] == 'text') {
                     if ($arFieldsAnswer[0]['FIELD_ID'] == $propertyNameId) {
                         $data['NAME'] = $arFieldsAnswer[0]['USER_TEXT'];
                     }
                     if ($arFieldsAnswer[0]['FIELD_ID'] == $propertyEmailId) {
                         $data['EMAIL'] = $arFieldsAnswer[0]['USER_TEXT'];
                     }
                 }
             }
             if (!empty($data['EMAIL'])) {
                 if (intval($formResult['USER_ID']) > 0) {
                     $data['USER_ID'] = intval($formResult['USER_ID']);
                 }
                 $dataResult[] = $data;
             }
         }
         $formResultsDb->InitFromArray($dataResult);
     }
     return $formResultsDb;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:35,代码来源:senderconnector.php

示例3: GetAdvGuestHost

	public static function GetAdvGuestHost($ADV_ID, $GUEST_ID, $IP_NUMBER, $BACK="")
	{
		$err_mess = "File: ".__FILE__."<br>Line: ";
		$DB = CDatabase::GetModuleConnection('statistic');
		$ADV_ID = intval($ADV_ID);
		$GID = intval($GUEST_ID);

		$strSql = "
			SELECT
				count(1) ADV_HOSTS,
				".$DB->DateToCharFunction("max(DATE_HOST_HIT)","SHORT")." MAX_DATE_HOST_HIT
			FROM	b_stat_adv_guest
			WHERE	ADV_ID=$ADV_ID and IP_NUMBER='".$DB->ForSQL($IP_NUMBER)."'
			$BACK
		";
		$rsResult=$DB->Query($strSql, false, $err_mess.__LINE__);
		if(!($arHost = $rsResult->Fetch()))
			$arHost = array("ADV_HOSTS"=>0,"MAX_DATE_HOST_HIT"=>false);

		$strSql = "
			SELECT
				count(1) ADV_GUESTS,
				".$DB->DateToCharFunction("max(DATE_GUEST_HIT)","SHORT")." MAX_DATE_GUEST_HIT
			FROM	b_stat_adv_guest
			WHERE	ADV_ID=$ADV_ID and GUEST_ID=$GID
			$BACK
		";
		$rsResult=$DB->Query($strSql, false, $err_mess.__LINE__);
		if(!($arGuest = $rsResult->Fetch()))
			$arGuest = array("ADV_GUESTS"=>0,"MAX_DATE_GUEST_HIT"=>false);

		$rsResult = new CDBResult;
		$rsResult->InitFromArray(array(array_merge($arGuest,$arHost)));
		return $rsResult;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:35,代码来源:statistic.php

示例4: GetLastByID

	public static function GetLastByID($ID)
	{
		$DB = CDatabase::GetModuleConnection('statistic');
		$ID = intval($ID);
		if($ID>0)
		{
			$strSql = "
				SELECT
					G.ID,
					G.FAVORITES,
					G.LAST_USER_ID,
					A.ID as LAST_ADV_ID,
					if(to_days(curdate())=to_days(G.LAST_DATE), 'Y', 'N') LAST
				FROM b_stat_guest G
				LEFT JOIN b_stat_adv A ON A.ID = G.LAST_ADV_ID
				WHERE G.ID='$ID'
				";
			$res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		}
		else
		{
			$res = new CDBResult;
			$res->InitFromArray(array());
		}
		return $res;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:26,代码来源:guest.php

示例5: getData

 /** @return \CDBResult */
 public function getData()
 {
     $groupId = $this->getFieldValue('GROUP_ID', null);
     $dateRegister = $this->getFieldValue('DATE_REGISTER', null);
     $active = $this->getFieldValue('ACTIVE', null);
     $filter = array();
     if ($groupId) {
         $filter['GROUP_ID'] = $groupId;
     }
     if (strlen($dateRegister) > 0) {
         if (\Bitrix\Main\Type\Date::isCorrect($dateRegister)) {
             $dateRegister = new \Bitrix\Main\Type\Date($dateRegister);
             $filter['><USER.DATE_REGISTER'] = array($dateRegister->toString(), $dateRegister->add('1 DAY')->toString());
         } else {
             $result = new \CDBResult();
             $result->InitFromArray(array());
             return $result;
         }
     }
     if ($active == 'Y') {
         $filter['USER.ACTIVE'] = $active;
     } elseif ($active == 'N') {
         $filter['USER.ACTIVE'] = $active;
     }
     $userDb = \Bitrix\Main\UserGroupTable::getList(array('select' => array('NAME' => 'USER.NAME', 'EMAIL' => 'USER.EMAIL', 'USER_ID'), 'filter' => $filter, 'group' => array('NAME', 'EMAIL', 'USER_ID'), 'order' => array('USER_ID' => 'ASC')));
     return new \CDBResult($userDb);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:28,代码来源:senderconnector.php

示例6: GetDropDown

	public static function GetDropDown($type="C", $siteID=false, $sla_id=false)
	{
		$err_mess = (CAllTicketDictionary::err_mess())."<br>Function: GetDropDown<br>Line: ";
		global $DB;
		if ($siteID==false || $siteID=="all")
		{
			$siteID = "";
		}
		$arFilter = array("TYPE" => $type, "SITE" => $siteID);
		$v2 = $v3 = null;
		$rs = CTicketDictionary::GetList(($v1="s_dropdown"), $v2, $arFilter, $v3);
		
		$oldFunctionality = COption::GetOptionString( "support", "SUPPORT_OLD_FUNCTIONALITY", "Y" );
		if( intval( $sla_id ) <= 0 || $oldFunctionality != "Y" || ( $type != "C" && $type!="K" && $type!="M" ) ) return $rs;
		
		switch($type)
		{
			case "C": $strSql = "SELECT CATEGORY_ID as DID FROM b_ticket_sla_2_category WHERE SLA_ID=" . intval( $sla_id ); break;
			case "K": $strSql = "SELECT CRITICALITY_ID as DID FROM b_ticket_sla_2_criticality WHERE SLA_ID=" . intval( $sla_id ); break;
			case "M": $strSql = "SELECT MARK_ID as DID FROM b_ticket_sla_2_mark WHERE SLA_ID=" . intval( $sla_id ); break;
		}
		$r = $DB->Query( $strSql, false, $err_mess . __LINE__ );
		while( $a = $r->Fetch() ) $arDID[] = $a["DID"];
		$arRecords = array();
		while( $ar = $rs->Fetch() ) if( is_array( $arDID ) && ( in_array( $ar["ID"], $arDID ) || in_array( 0,$arDID ) ) ) $arRecords[] = $ar;
		
		$rs = new CDBResult;
		$rs->InitFromArray($arRecords);
		
		return $rs;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:31,代码来源:dictionary.php

示例7: GetList

 public static function GetList($arOrder = array('CREATED_DATE' => 'DESC'), $arFilter = array(), $arSelect = array(), $nPageTop = false)
 {
     // Fix for #27449
     if (!CModule::IncludeModule('calendar')) {
         $obRes = new CDBResult();
         $obRes->InitFromArray(array());
         return $obRes;
     }
     global $USER;
     $ENTITY_ID = 'CALENDAR_EVENT';
     $arElement = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields($ENTITY_ID, 0, LANGUAGE_ID);
     if ($arElement == false || !isset($arElement['UF_CRM_CAL_EVENT'])) {
         $arFields = array();
         $arFields['ENTITY_ID'] = $ENTITY_ID;
         $arFields['FIELD_NAME'] = 'UF_CRM_CAL_EVENT';
         $arFields['USER_TYPE_ID'] = 'crm';
         $arFields['EDIT_FORM_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
         $arFields['LIST_COLUMN_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
         $arFields['LIST_FILTER_LABEL'][LANGUAGE_ID] = GetMessage('CRM_UF_NAME');
         $arFields['SETTINGS']['LEAD'] = 'Y';
         $arFields['SETTINGS']['CONTACT'] = 'Y';
         $arFields['SETTINGS']['COMPANY'] = 'Y';
         $arFields['SETTINGS']['DEAL'] = 'Y';
         $arFields['MULTIPLE'] = 'Y';
         $CAllUserTypeEntity = new CUserTypeEntity();
         $CAllUserTypeEntity->Add($arFields);
     }
     if (isset($arFilter['ENTITY_TYPE']) && isset($arFilter['ENTITY_ID'])) {
         $arFilter['ENTITY_TYPE'] = CUserTypeCrm::GetShortEntityType($arFilter['ENTITY_TYPE']);
         $arFilter['UF_CRM_CAL_EVENT'] = $arFilter['ENTITY_TYPE'] . '_' . $arFilter['ENTITY_ID'];
         unset($arFilter['ENTITY_TYPE'], $arFilter['ENTITY_ID']);
     } else {
         if (!empty($arFilter['ENTITY_TYPE'])) {
             $arFilter['ENTITY_TYPE'] = CUserTypeCrm::GetShortEntityType($arFilter['ENTITY_TYPE']);
             $arFilter['%UF_CRM_CAL_EVENT'] = $arFilter['ENTITY_TYPE'] . '_';
             unset($arFilter['ENTITY_TYPE']);
         } else {
             $arFilter['!=UF_CRM_CAL_EVENT'] = '';
         }
     }
     $arFilter['CAL_TYPE'] = 'user';
     $arFilter['DELETED'] = 'N';
     if (isset($arFilter['OWNER_ID']) && is_array($arFilter['OWNER_ID'])) {
         $arFilter['OWNER_ID'] = current($arFilter['OWNER_ID']);
     }
     $arCal = CCalendarEvent::GetList(array('arFilter' => $arFilter, 'parseRecursion' => false, 'userId' => $USER->GetID(), 'fetchAttendees' => false, 'fetchMeetings' => true));
     $obRes = new CDBResult();
     $obRes->InitFromArray($arCal);
     return $obRes;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:50,代码来源:crm_activity_calendar.php

示例8: GetList

 /**
  * @param $by
  * @param $order
  * @param $arFilter
  *
  * @return CDBResult
  *
  * пока не знаю для чего эта функция, но может пригодиться
  */
 function GetList($by, $order, $arFilter)
 {
     global $DB;
     $query = $DB->Query('SELECT "NAME, CHANGED" FROM p_parser_res_list');
     while ($res = $query->Fetch()) {
         $elem['ID'] = $res['ID'];
         $elem['NAME'] = $res['NAME'];
         $elem['ACTIVE'] = $res['ACTIVE'];
         $elem['DATE_ACTIVE_FROM'] = $res['DATE_ACTIVE_FROM'];
         $elem['DATE_ACTIVE_TO'] = $res['DATE_ACTIVE_TO'];
         $arResult[] = $elem;
     }
     $result = new CDBResult();
     $result->InitFromArray($arResult);
     return $result;
 }
开发者ID:dtvs01,项目名称:Parser,代码行数:25,代码来源:parser_class.php

示例9: GetByID

 public static function GetByID($ID, $bFull = false)
 {
     global $DB;
     if ($res = self::_GetWhere($ID)) {
         $res = $DB->Query('SELECT * FROM b_intranet_sharepoint WHERE ' . $res);
         if ($bFull) {
             if ($arRes = $res->Fetch()) {
                 $res = $DB->Query('SELECT * FROM b_intranet_sharepoint_field WHERE IBLOCK_ID=\'' . $arRes['IBLOCK_ID'] . '\'');
                 $arRes['FIELDS'] = array();
                 while ($arField = $res->Fetch()) {
                     $arRes['FIELDS'][] = $arField;
                 }
                 $res = new CDBResult();
                 $res->InitFromArray(array($arRes));
             }
         }
     } else {
         $res = new CDBResult();
     }
     return $res;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:21,代码来源:sharepoint.php

示例10: GetList

 public static function GetList($arFilter = array(), $arGroupBy = false, $arSelectFields = array())
 {
     $params = array();
     if (is_array($arFilter) && !empty($arFilter)) {
         if (isset($arFilter["DELIVERY_ID"]) || $arFilter["DELIVERY_PROFILE_ID"]) {
             $ids = self::convertDeliveryIds(isset($arFilter["DELIVERY_ID"]) ? $arFilter["DELIVERY_ID"] : array(), isset($arFilter["DELIVERY_PROFILE_ID"]) ? $arFilter["DELIVERY_PROFILE_ID"] : array());
             if (!empty($ids)) {
                 $arFilter["=DELIVERY_ID"] = $ids;
             }
             unset($arFilter["DELIVERY_ID"]);
             unset($arFilter["DELIVERY_PROFILE_ID"]);
         }
         if (isset($arFilter["PAYSYSTEM_ID"])) {
             $arFilter["=PAYSYSTEM_ID"] = $arFilter["PAYSYSTEM_ID"];
             unset($arFilter["PAYSYSTEM_ID"]);
         }
         $params['filter'] = $arFilter;
     }
     //todo:
     if (is_array($arGroupBy) && !empty($arGroupBy)) {
         $params['group'] = array_intersect($arGroupBy, array("DELIVERY_ID", "PAYSYSTEM_ID"));
     }
     $params["select"] = array("DELIVERY_ID", "PAYSYSTEM_ID", "DELIVERY_SERVICE_CODE" => "DELIVERY_SERVICE.CODE");
     $params["runtime"] = array(new \Bitrix\Main\Entity\ReferenceField('DELIVERY_SERVICE', 'Bitrix\\Sale\\Delivery\\Services\\Table', array('=this.DELIVERY_ID' => 'ref.ID')));
     $records = array();
     $res = DeliveryPaySystemTable::getList($params);
     while ($record = $res->fetch()) {
         $delivery = CSaleDeliveryHelper::getDeliverySIDAndProfile($record["DELIVERY_SERVICE_CODE"]);
         $record["DELIVERY_ID"] = $delivery["SID"];
         $record["DELIVERY_PROFILE_ID"] = isset($delivery["PROFILE"]) ? $delivery["PROFILE"] : null;
         unset($record["DELIVERY_SERVICE_CODE"]);
         $records[] = $record;
     }
     $result = new \CDBResult();
     $result->InitFromArray($records);
     return $result;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:37,代码来源:delivery_2_pay_system.php

示例11: getMixedList

 protected function getMixedList($arOrder = array("SORT" => "ASC"), $arFilter = array(), $bIncCnt = false, $arSelectedFields = false)
 {
     $arResult = array();
     $notFound = false;
     if (is_array($arFilter["S_ID"]) && sizeof($arFilter["S_ID"]) == 1) {
         $notFound = $arFilter['S_ID'][0] == 0;
     }
     if (!$notFound && !$this->isFiltering()) {
         $arSectionFilter = array("IBLOCK_ID" => $arFilter["IBLOCK_ID"], "=ID" => $arFilter["S_ID"], "?NAME" => $arFilter["NAME"], ">=TIMESTAMP_X" => $arFilter["DATE_MODIFY_FROM"], "<=TIMESTAMP_X" => $arFilter["DATE_MODIFY_TO"], "CODE" => $arFilter["CODE"], "ACTIVE" => $arFilter["ACTIVE"]);
         if (isset($arFilter["CHECK_PERMISSIONS"])) {
             $arSectionFilter['CHECK_PERMISSIONS'] = $arFilter["CHECK_PERMISSIONS"];
             $arSectionFilter['MIN_PERMISSION'] = isset($arFilter['MIN_PERMISSION']) ? $arFilter['MIN_PERMISSION'] : 'R';
         }
         if (array_key_exists("SECTION_ID", $arFilter)) {
             if (!array_key_exists("INCLUDE_SUBSECTIONS", $arFilter)) {
                 $arSectionFilter['SECTION_ID'] = $arFilter['SECTION_ID'];
             } elseif (!$this->isAdvancedSearchAvailable() && ($margin = $this->getSectionMargin($arFilter['SECTION_ID']))) {
                 $arSectionFilter['>LEFT_MARGIN'] = $margin['LEFT_MARGIN'];
                 $arSectionFilter['<RIGHT_MARGIN'] = $margin['RIGHT_MARGIN'];
                 $arSectionFilter['>DEPTH_LEVEL'] = $margin['DEPTH_LEVEL'];
             }
         }
         $obSection = new \CIBlockSection();
         $rsSection = $obSection->GetList($arOrder, $arSectionFilter, $bIncCnt);
         while ($arSection = $rsSection->Fetch()) {
             $arSection["TYPE"] = "S";
             $arResult[] = $arSection;
         }
     }
     $notFound = false;
     if (is_array($arFilter["ID"]) && sizeof($arFilter["ID"]) == 1) {
         $notFound = $arFilter['ID'][0] == 0;
     }
     if (!$notFound) {
         $arElementFilter = array("IBLOCK_ID" => $arFilter["IBLOCK_ID"], "?NAME" => $arFilter["NAME"], "SECTION_ID" => $arFilter["SECTION_ID"], "=ID" => $arFilter["ID"], ">=TIMESTAMP_X" => $arFilter["DATE_MODIFY_FROM"], "<=TIMESTAMP_X" => $arFilter["DATE_MODIFY_TO"], "CODE" => $arFilter["CODE"], "ACTIVE" => $arFilter["ACTIVE"], "WF_STATUS" => $arFilter["WF_STATUS"], 'INCLUDE_SUBSECTIONS' => $arFilter["INCLUDE_SUBSECTIONS"]);
         if (isset($arFilter["CHECK_PERMISSIONS"])) {
             $arElementFilter['CHECK_PERMISSIONS'] = $arFilter["CHECK_PERMISSIONS"];
             $arElementFilter['MIN_PERMISSION'] = isset($arFilter['MIN_PERMISSION']) ? $arFilter['MIN_PERMISSION'] : 'R';
         }
         foreach ($arFilter as $key => $value) {
             $op = \CIBlock::MkOperationFilter($key);
             $newkey = strtoupper($op["FIELD"]);
             if (substr($newkey, 0, 9) == "PROPERTY_" || substr($newkey, 0, 8) == "CATALOG_") {
                 $arElementFilter[$key] = $value;
             }
         }
         if (strlen($arFilter["SECTION_ID"]) <= 0) {
             unset($arElementFilter["SECTION_ID"]);
         }
         if (!is_array($arSelectedFields)) {
             $arSelectedFields = array("ID", "IBLOCK_ID", "IBLOCK_SECTION_ID", "ACTIVE", "SORT", "NAME", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_PICTURE", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "SHOW_COUNTER", "SHOW_COUNTER_START", "CODE", "EXTERNAL_ID");
         }
         if (isset($arFilter["CHECK_BP_PERMISSIONS"])) {
             $arElementFilter["CHECK_BP_PERMISSIONS"] = $arFilter["CHECK_BP_PERMISSIONS"];
         }
         $obElement = new \CIBlockElement();
         $rsElement = $obElement->GetList($arOrder, $arElementFilter, false, false, $arSelectedFields);
         while ($arElement = $rsElement->Fetch()) {
             $arElement["TYPE"] = "E";
             $arResult[] = $arElement;
         }
     }
     $rsResult = new \CDBResult();
     $rsResult->InitFromArray($arResult);
     if ($this->isAdminSection()) {
         $rsResult = new \CAdminResult($rsResult, $this->getTableId());
         $rsResult->NavStart();
     } else {
         $rsResult->NavStart($this->getGridOptions()->GetNavParams());
     }
     return $rsResult;
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:72,代码来源:class.php

示例12: GetList

 function GetList($arOrder = array("SORT" => "ASC"), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
 {
     global $USER;
     $arFilter["SHOW_NEW"] = "Y";
     $arFilter["ACTIVE"] = "Y";
     if (count($arSelectFields) > 0) {
         if (!in_array("ID", $arSelectFields)) {
             $arSelectFields[] = "ID";
         }
         if (!in_array("IBLOCK_ID", $arSelectFields)) {
             $arSelectFields[] = "IBLOCK_ID";
         }
         if (!in_array("CREATED_BY", $arSelectFields)) {
             $arSelectFields[] = "CREATED_BY";
         }
     }
     $arResultList = array();
     $arIDMap = array();
     $dbTasksList = CIBlockElement::GetList($arOrder, $arFilter, $arGroupBy, $arNavStartParams, $arSelectFields);
     while ($obTask = $dbTasksList->GetNextElement()) {
         $arResult = array();
         $arFields = $obTask->GetFields();
         foreach ($arFields as $fieldKey => $fieldValue) {
             if (substr($fieldKey, 0, 1) != "~") {
                 continue;
             }
             $fieldKey = substr($fieldKey, 1);
             $arResult[$fieldKey] = $fieldValue;
             $arResult[$fieldKey . "_PRINTABLE"] = $fieldValue;
             if (in_array($fieldKey, array("MODIFIED_BY", "CREATED_BY"))) {
                 $arResult[$fieldKey] = "user_" . $fieldValue;
                 $arResult[$fieldKey . "_PRINTABLE"] = self::PrepareUserForPrint($fieldValue);
             }
         }
         $arProperties = $obTask->GetProperties();
         foreach ($arProperties as $propertyKey => $propertyValue) {
             $arResult["PROPERTY_" . $propertyKey] = $propertyValue["~VALUE"];
             $arResult["PROPERTY_" . $propertyKey . "_PRINTABLE"] = $propertyValue["~VALUE"];
             if (strlen($propertyValue["USER_TYPE"]) > 0) {
                 if ($propertyValue["USER_TYPE"] == "UserID") {
                     if (is_array($propertyValue["VALUE"])) {
                         $arResult["PROPERTY_" . $propertyKey] = array();
                         foreach ($propertyValue["VALUE"] as $v) {
                             $v = intval($v);
                             if ($v > 0) {
                                 $arResult["PROPERTY_" . $propertyKey][] = "user_" . $v;
                             }
                         }
                     } else {
                         $arResult["PROPERTY_" . $propertyKey] = "";
                         if (intval($propertyValue["VALUE"]) > 0) {
                             $arResult["PROPERTY_" . $propertyKey] = "user_" . intval($propertyValue["VALUE"]);
                         }
                     }
                     $arResult["PROPERTY_" . $propertyKey . "_PRINTABLE"] = self::PrepareUserForPrint($propertyValue["VALUE"]);
                 }
             } elseif ($propertyValue["PROPERTY_TYPE"] == "G") {
                 $arResult["PROPERTY_" . $propertyKey . "_PRINTABLE"] = array();
                 $vx = self::PrepareSectionForPrint($propertyValue["VALUE"], $propertyValue["LINK_IBLOCK_ID"]);
                 foreach ($vx as $vx1 => $vx2) {
                     $arResult["PROPERTY_" . $propertyKey . "_PRINTABLE"][$vx1] = $vx2["NAME"];
                 }
             } elseif ($propertyValue["PROPERTY_TYPE"] == "L") {
                 $arResult["PROPERTY_" . $propertyKey] = array();
                 $arPropertyValue = $propertyValue["VALUE"];
                 $arPropertyKey = $propertyValue["VALUE_ENUM_ID"];
                 if (!is_array($arPropertyValue)) {
                     $arPropertyValue = array($arPropertyValue);
                     $arPropertyKey = array($arPropertyKey);
                 }
                 for ($i = 0, $cnt = count($arPropertyValue); $i < $cnt; $i++) {
                     $arResult["PROPERTY_" . $propertyKey][$arPropertyKey[$i]] = $arPropertyValue[$i];
                 }
                 $arResult["PROPERTY_" . $propertyKey . "_PRINTABLE"] = $arResult["PROPERTY_" . $propertyKey];
             }
         }
         if (array_key_exists($arFields["ID"], $arIDMap)) {
             foreach ($arResultList[$arIDMap[$arFields["ID"]]] as $key => &$value) {
                 if ($value != $arResult[$key]) {
                     if (!is_array($value)) {
                         $value = array($value);
                     }
                     $value[] = $arResult[$key];
                 }
             }
         } else {
             $index = count($arResultList);
             $arResultList[$index] = $arResult;
             $arIDMap[$arFields["ID"]] = $index;
         }
     }
     $dbTasksList1 = new CDBResult();
     $dbTasksList1->InitFromArray($arResultList);
     return array($dbTasksList1, $dbTasksList);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:95,代码来源:virtualdocument.php

示例13: GetByID

 function GetByID($FILE_ID)
 {
     global $DB;
     $FILE_ID = intval($FILE_ID);
     if (CACHED_b_file === false) {
         $strSql = "SELECT f.*," . $DB->DateToCharFunction("f.TIMESTAMP_X") . " as TIMESTAMP_X FROM b_file f WHERE f.ID=" . $FILE_ID;
         $z = $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br>LINE: " . __LINE__);
     } else {
         $arFiles = CFile::GetFromCache($FILE_ID);
         $z = new CDBResult();
         $z->InitFromArray(array_key_exists($FILE_ID, $arFiles) ? array($arFiles[$FILE_ID]) : array());
     }
     return $z;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:14,代码来源:file.php

示例14: array

// advancing sorting is necessary if old history results are mixed with new order changes
if ($bUseOldHistory)
{
	$arData = array();
	foreach ($arHistoryData as $index => $arHistoryRecord)
		$arData[$index]  = $arHistoryRecord[$by];

	$arIds = array();
	foreach ($arHistoryData as $index => $arHistoryRecord)
		$arIds[$index]  = $arHistoryRecord["ID"];

	array_multisort($arData, constant("SORT_".ToUpper($order)), $arIds, constant("SORT_".ToUpper($order)), $arHistoryData);
}

$dbRes = new CDBResult;
$dbRes->InitFromArray($arHistoryData);

$dbRecords = new CAdminResult($dbRes, $sTableID_tab5);
$dbRecords->NavStart();
$lAdmin_tab5->NavText($dbRecords->GetNavPrint(GetMessage('SOD_HIST_LIST')));

$histdHeader = array(
	array("id"=>"DATE_CREATE", "content"=>GetMessage("SOD_HIST_H_DATE"), "sort"=>"DATE_CREATE", "default"=>true),
	array("id"=>"USER_ID", "content"=>GetMessage("SOD_HIST_H_USER"), "sort"=>"USER_ID", "default"=>true),
	array("id"=>"TYPE", "content"=>GetMessage("SOD_HIST_TYPE"), "sort"=>"TYPE", "default"=>true),
	array("id"=>"DATA", "content"=>GetMessage("SOD_HIST_DATA"), "sort"=>"", "default"=>true),
);

$lAdmin_tab5->AddHeaders($histdHeader);

$arOperations = array();
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:order_detail.php

示例15: GetList

	function GetList($aSort=array(), $aFilter=array())
	{
		global $DB, $CACHE_MANAGER;

		if(CACHED_b_user_field_enum !== false)
		{
			$cacheId = "b_user_field_enum".md5(serialize($aSort).".".serialize($aFilter));
			if($CACHE_MANAGER->Read(CACHED_b_user_field_enum, $cacheId, "b_user_field_enum"))
			{
				$arResult = $CACHE_MANAGER->Get($cacheId);
				$res = new CDBResult;
				$res->InitFromArray($arResult);
				return $res;
			}
		}
		else
		{
			$cacheId = '';
		}

		$bJoinUFTable = false;
		$arFilter = array();
		foreach($aFilter as $key=>$val)
		{
			if(is_array($val))
			{
				if(count($val) <= 0)
					continue;
				$val = array_map(array($DB, "ForSQL"), $val);
				$val = "('".implode("', '", $val)."')";
			}
			else
			{
				if(strlen($val) <= 0)
					continue;
				$val = "('".$DB->ForSql($val)."')";
			}

			$key = strtoupper($key);
			switch($key)
			{
			case "ID":
			case "USER_FIELD_ID":
			case "VALUE":
			case "DEF":
			case "SORT":
			case "XML_ID":
				$arFilter[] = "UFE.".$key." in ".$val;
				break;
			case "USER_FIELD_NAME":
				$bJoinUFTable = true;
				$arFilter[] = "UF.FIELD_NAME in ".$val;
				break;
			}
		}

		$arOrder = array();
		foreach($aSort as $key=>$val)
		{
			$key = strtoupper($key);
			$ord = (strtoupper($val) <> "ASC"? "DESC": "ASC");
			switch($key)
			{
				case "ID":
				case "USER_FIELD_ID":
				case "VALUE":
				case "DEF":
				case "SORT":
				case "XML_ID":
					$arOrder[] = "UFE.".$key." ".$ord;
					break;
			}
		}
		if(count($arOrder) == 0)
		{
			$arOrder[] = "UFE.SORT asc";
			$arOrder[] = "UFE.ID asc";
		}
		DelDuplicateSort($arOrder);
		$sOrder = "\nORDER BY ".implode(", ", $arOrder);

		if(count($arFilter) == 0)
			$sFilter = "";
		else
			$sFilter = "\nWHERE ".implode("\nAND ", $arFilter);

		$strSql = "
			SELECT
				UFE.ID
				,UFE.USER_FIELD_ID
				,UFE.VALUE
				,UFE.DEF
				,UFE.SORT
				,UFE.XML_ID
			FROM
				b_user_field_enum UFE
				".($bJoinUFTable? "INNER JOIN b_user_field UF ON UF.ID = UFE.USER_FIELD_ID": "")."
			".$sFilter.$sOrder;

		if($cacheId == '')
//.........这里部分代码省略.........
开发者ID:nycmic,项目名称:bittest,代码行数:101,代码来源:usertype.php


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