當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AssetModel::InstantiateDbResult方法代碼示例

本文整理匯總了PHP中AssetModel::InstantiateDbResult方法的典型用法代碼示例。如果您正苦於以下問題:PHP AssetModel::InstantiateDbResult方法的具體用法?PHP AssetModel::InstantiateDbResult怎麽用?PHP AssetModel::InstantiateDbResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AssetModel的用法示例。


在下文中一共展示了AssetModel::InstantiateDbResult方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: LoadArrayBySearch

    public static function LoadArrayBySearch($intCategoryId = null, $intManufacturerId = null, $strDescription = null, $strAssetModelCode = null, $arrCustomFields = null, $strDateModified = null, $strDateModifiedFirst = null, $strDateModifiedLast = null, $blnAttachment = null, $strOrderBy = null, $strLimit = null, $objExpansionMap = null)
    {
        AssetModel::ArrayQueryHelper($strOrderBy, $strLimit, $strLimitPrefix, $strLimitSuffix, $strExpandSelect, $strExpandFrom, $objExpansionMap, $objDatabase);
        // Setup QueryExpansion
        $objQueryExpansion = new QQueryExpansion();
        if ($objExpansionMap) {
            try {
                AssetModel::ExpandQuery('asset_model', null, $objExpansionMap, $objQueryExpansion);
            } catch (QCallerException $objExc) {
                $objExc->IncrementOffset();
                throw $objExc;
            }
        }
        $arrSearchSql = AssetModel::GenerateSearchSql($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment);
        $arrCustomFieldSql = CustomField::GenerateSql(EntityQtype::AssetModel);
        $arrAttachmentSql = Attachment::GenerateSql(EntityQtype::AssetModel);
        $strQuery = sprintf('
				SELECT
					%s
					COUNT( `asset`.`asset_id`) AS asset_count,
					`asset_model`.`asset_model_id` AS `asset_model_id`,
					`asset_model`.`category_id` AS `category_id`,
					`asset_model`.`manufacturer_id` AS `manufacturer_id`,
					`asset_model`.`asset_model_code` AS `asset_model_code`,
					`asset_model`.`short_description` AS `short_description`,
					`asset_model`.`long_description` AS `long_description`,
					`asset_model`.`image_path` AS `image_path`,
					`asset_model`.`created_by` AS `created_by`,
					`asset_model`.`creation_date` AS `creation_date`,
					`asset_model`.`modified_by` AS `modified_by`,
					`asset_model`.`modified_date` AS `modified_date`
					%s
					%s
					%s
				FROM
					`asset_model` AS `asset_model`
					LEFT JOIN `asset` AS `asset` ON `asset_model`.`asset_model_id` = `asset`.`asset_model_id` AND `asset`.`location_id` != 2 AND `asset`.`location_id` != 5
					%s
					%s
					%s
				WHERE
				1=1
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
				%s
			', $strLimitPrefix, $objQueryExpansion->GetSelectSql(",\n\t\t\t\t\t", ",\n\t\t\t\t\t"), $arrCustomFieldSql['strSelect'], $arrAttachmentSql['strSelect'], $objQueryExpansion->GetFromSql("", "\n\t\t\t\t\t"), $arrCustomFieldSql['strFrom'], $arrAttachmentSql['strFrom'], $arrSearchSql['strCategorySql'], $arrSearchSql['strManufacturerSql'], $arrSearchSql['strDescriptionSql'], $arrSearchSql['strAssetModelCodeSql'], $arrSearchSql['strDateModifiedSql'], $arrSearchSql['strAttachmentSql'], $arrSearchSql['strAuthorizationSql'], $arrAttachmentSql['strGroupBy'], $strOrderBy, $strLimitSuffix);
        $objDbResult = $objDatabase->Query($strQuery);
        return AssetModel::InstantiateDbResult($objDbResult);
    }
開發者ID:heshuai64,項目名稱:einv2,代碼行數:56,代碼來源:AssetModel.class.php

示例2: QueryArray

 /**
  * Static Qcodo Query method to query for an array of AssetModel objects.
  * Uses BuildQueryStatment to perform most of the work.
  * @param QQCondition $objConditions any conditions on the query, itself
  * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
  * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
  * @return AssetModel[] the queried objects as an array
  */
 public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null)
 {
     // Get the Query Statement
     try {
         $strQuery = AssetModel::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Perform the Query and Instantiate the Array Result
     $objDbResult = $objQueryBuilder->Database->Query($strQuery);
     return AssetModel::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes);
 }
開發者ID:heshuai64,項目名稱:einv2,代碼行數:21,代碼來源:AssetModelGen.class.php

示例3: switch

						`%s` AS `%s`
						%s
					WHERE
					1=1
				', $strTableName, $strTableName, $strTableName, $arrCustomFieldSql['strSelect'], $strTableName, $strTableName, $arrCustomFieldSql['strFrom']);
    $objDatabase = QApplication::$Database[1];
    $objDbResult = $objDatabase->Query($strQuery);
    switch ($intEntityQtypeId) {
        case 1:
            $objArray = Asset::InstantiateDbResult($objDbResult);
            break;
        case 2:
            $objArray = InventoryModel::InstantiateDbResult($objDbResult);
            break;
        case 4:
            $objArray = AssetModel::InstantiateDbResult($objDbResult);
            break;
        case 5:
            $objArray = Manufacturer::InstantiateDbResult($objDbResult);
            break;
        case 6:
            $objArray = Category::InstantiateDbResult($objDbResult);
            break;
        case 7:
            $objArray = Company::InstantiateDbResult($objDbResult);
            break;
        case 8:
            $objArray = Contact::InstantiateDbResult($objDbResult);
            break;
        case 9:
            $objArray = Address::InstantiateDbResult($objDbResult);
開發者ID:brustj,項目名稱:tracmor,代碼行數:31,代碼來源:custom_field_helper_migration.php

示例4: GetJournalForId

 /**
  * Gets the historical journal for an object from the log database.
  * Objects will have VirtualAttributes available to lookup login, date, and action information from the journal object.
  * @param integer intAssetModelId
  * @return AssetModel[]
  */
 public static function GetJournalForId($intAssetModelId)
 {
     $objDatabase = AssetModel::GetDatabase()->JournalingDatabase;
     $objResult = $objDatabase->Query('SELECT * FROM asset_model WHERE asset_model_id = ' . $objDatabase->SqlVariable($intAssetModelId) . ' ORDER BY __sys_date');
     return AssetModel::InstantiateDbResult($objResult);
 }
開發者ID:proxymoron,項目名稱:tracmor,代碼行數:12,代碼來源:AssetModelGen.class.php


注:本文中的AssetModel::InstantiateDbResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。