本文整理汇总了PHP中Asset::QuerySingle方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::QuerySingle方法的具体用法?PHP Asset::QuerySingle怎么用?PHP Asset::QuerySingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::QuerySingle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetupAsset
public function SetupAsset($objCaller = null)
{
// Lookup Object PK information from Query String (if applicable)
// Set mode to Edit or New depending on what's found
// Overridden from AssetEditFormBase to add the $objCaller parameter
$intAssetId = QApplication::QueryString('intAssetId');
if ($intAssetId) {
//$objCaller->objAsset = Asset::Load($intAssetId);
// To minimize the count of queries
$objClauses = array();
array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel));
array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel->Category));
array_push($objClauses, QQ::Expand(QQN::Asset()->AssetModel->Manufacturer));
array_push($objClauses, QQ::Expand(QQN::Asset()->ParentAsset));
array_push($objClauses, QQ::Expand(QQN::Asset()->Location));
array_push($objClauses, QQ::Expand(QQN::Asset()->CreatedByObject));
$objCaller->objAsset = Asset::QuerySingle(QQ::Equal(QQN::Asset()->AssetId, $intAssetId), $objClauses);
if (!$objCaller->objAsset) {
throw new Exception('Could not find a Asset object with PK arguments: ' . $intAssetId);
}
$objCaller->strTitleVerb = QApplication::Translate('Edit');
$objCaller->blnEditMode = true;
$this->blnEditChild = true;
} else {
$objCaller->objAsset = new Asset();
$objCaller->strTitleVerb = QApplication::Translate('Create');
$objCaller->blnEditMode = false;
}
QApplication::AuthorizeEntity($objCaller->objAsset, $objCaller->blnEditMode);
}
示例2: LoadByAssetCode
/**
* Load a single Asset object,
* by AssetCode Index(es)
* @param string $strAssetCode
* @return Asset
*/
public static function LoadByAssetCode($strAssetCode)
{
return Asset::QuerySingle(QQ::Equal(QQN::Asset()->AssetCode, $strAssetCode));
}
示例3: dtgAudit_Bind
protected function dtgAudit_Bind()
{
if ($this->rblDiscrepancy->SelectedValue == 'discrepancies') {
$objConditions = QQ::AndCondition(QQ::Equal(QQN::AuditScan()->AuditId, $_GET['intAuditId']), QQ::NotEqual(QQN::AuditScan()->Count, QQN::AuditScan()->SystemCount));
} else {
$objConditions = QQ::Equal(QQN::AuditScan()->AuditId, $_GET['intAuditId']);
}
$objAuditScanArray = AuditScan::QueryArray($objConditions, QQ::Clause(QQ::Expand(QQN::AuditScan()->Location), $this->dtgAudit->OrderByClause));
if ($objAuditScanArray) {
foreach ($objAuditScanArray as $objAuditScan) {
$objAuditScan->Asset = Asset::QuerySingle(QQ::Equal(QQN::Asset()->AssetId, $objAuditScan->EntityId), QQ::Clause(QQ::Expand(QQN::Asset()->AssetModel)));
}
}
if (count($objAuditScanArray) == 0) {
$this->dtgAudit->ShowHeader = false;
} else {
$this->dtgAudit->ShowHeader = true;
}
$this->dtgAudit->DataSource = $objAuditScanArray;
}
示例4: LoadByAssetCode
/**
* Load a single Asset object,
* by AssetCode Index(es)
* @param string $strAssetCode
* @return Asset
*/
public static function LoadByAssetCode($strAssetCode, $objOptionalClauses = null)
{
return Asset::QuerySingle(QQ::Equal(QQN::Asset()->AssetCode, $strAssetCode), $objOptionalClauses);
}