本文整理匯總了PHP中AssetModel::QueryHelper方法的典型用法代碼示例。如果您正苦於以下問題:PHP AssetModel::QueryHelper方法的具體用法?PHP AssetModel::QueryHelper怎麽用?PHP AssetModel::QueryHelper使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AssetModel
的用法示例。
在下文中一共展示了AssetModel::QueryHelper方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CountBySearch
public static function CountBySearch($intCategoryId = null, $intManufacturerId = null, $strDescription = null, $strAssetModelCode = null, $arrCustomFields = null, $strDateModified = null, $strDateModifiedFirst = null, $strDateModifiedLast = null, $blnAttachment = null, $objExpansionMap = null)
{
// Call to QueryHelper to Get the Database Object
AssetModel::QueryHelper($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
COUNT(asset_model.asset_model_id) AS row_count
FROM
`asset_model` AS `asset_model`
%s
%s
%s
WHERE
1=1
%s
%s
%s
%s
%s
%s
%s
%s
', $objQueryExpansion->GetFromSql("", "\n\t\t\t\t\t"), $arrAttachmentSql['strFrom'], $arrCustomFieldSql['strFrom'], $arrSearchSql['strCategorySql'], $arrSearchSql['strManufacturerSql'], $arrSearchSql['strDescriptionSql'], $arrSearchSql['strAssetModelCodeSql'], $arrSearchSql['strCustomFieldsSql'], $arrSearchSql['strDateModifiedSql'], $arrSearchSql['strAttachmentSql'], $arrSearchSql['strAuthorizationSql']);
//echo($strQuery); exit;
$objDbResult = $objDatabase->Query($strQuery);
$strDbRow = $objDbResult->FetchRow();
return QType::Cast($strDbRow[0], QType::Integer);
}