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


PHP Asset::QuerySingle方法代码示例

本文整理汇总了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);
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:30,代码来源:asset_edit.php

示例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));
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:10,代码来源:AssetGen.class.php

示例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;
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:20,代码来源:asset_audit_view.php

示例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);
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:10,代码来源:AssetGen.class.php


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