本文整理汇总了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);
}