/** * Load a single AssetTransactionCheckout object, * by AssetId * @param integer $intAssetId * @return object $objAssetTransactionCheckout */ public function LoadAssetTransactionCheckoutByAssetId($intAssetId = null) { // Loads objAssetTransaction $objClauses = array(); $objOrderByClause = QQ::OrderBy(QQN::AssetTransaction()->Transaction->CreationDate, false); $objLimitClause = QQ::LimitInfo(1, 0); array_push($objClauses, $objOrderByClause); array_push($objClauses, $objLimitClause); $AssetTransactionArray = AssetTransaction::LoadArrayByAssetId($this->AssetId, $objClauses); $intLastAssetTransactionId = $AssetTransactionArray[0]->AssetTransactionId; $objAssetTransactionCheckout = AssetTransactionCheckout::LoadByAssetTransactionId($intAssetLastTransactionId); return $objAssetTransactionCheckout; }
/** * Override method to perform a property "Get" * This will get the value of $strName * * @param string $strName Name of the property to get * @return mixed */ public function __get($strName) { switch ($strName) { /////////////////// // Member Variables /////////////////// case 'AssetTransactionId': // Gets the value for intAssetTransactionId (Read-Only PK) // @return integer return $this->intAssetTransactionId; case 'AssetId': // Gets the value for intAssetId (Not Null) // @return integer return $this->intAssetId; case 'TransactionId': // Gets the value for intTransactionId (Not Null) // @return integer return $this->intTransactionId; case 'ParentAssetTransactionId': // Gets the value for intParentAssetTransactionId // @return integer return $this->intParentAssetTransactionId; case 'SourceLocationId': // Gets the value for intSourceLocationId // @return integer return $this->intSourceLocationId; case 'DestinationLocationId': // Gets the value for intDestinationLocationId // @return integer return $this->intDestinationLocationId; case 'NewAssetFlag': // Gets the value for blnNewAssetFlag // @return boolean return $this->blnNewAssetFlag; case 'NewAssetId': // Gets the value for intNewAssetId // @return integer return $this->intNewAssetId; case 'ScheduleReceiptFlag': // Gets the value for blnScheduleReceiptFlag // @return boolean return $this->blnScheduleReceiptFlag; case 'ScheduleReceiptDueDate': // Gets the value for dttScheduleReceiptDueDate // @return QDateTime return $this->dttScheduleReceiptDueDate; case 'CreatedBy': // Gets the value for intCreatedBy // @return integer return $this->intCreatedBy; case 'CreationDate': // Gets the value for dttCreationDate // @return QDateTime return $this->dttCreationDate; case 'ModifiedBy': // Gets the value for intModifiedBy // @return integer return $this->intModifiedBy; case 'ModifiedDate': // Gets the value for strModifiedDate (Read-Only Timestamp) // @return string return $this->strModifiedDate; /////////////////// // Member Objects /////////////////// /////////////////// // Member Objects /////////////////// case 'Asset': // Gets the value for the Asset object referenced by intAssetId (Not Null) // @return Asset try { if (!$this->objAsset && !is_null($this->intAssetId)) { $this->objAsset = Asset::Load($this->intAssetId); } return $this->objAsset; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'Transaction': // Gets the value for the Transaction object referenced by intTransactionId (Not Null) // @return Transaction try { if (!$this->objTransaction && !is_null($this->intTransactionId)) { $this->objTransaction = Transaction::Load($this->intTransactionId); } return $this->objTransaction; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ParentAssetTransaction': // Gets the value for the AssetTransaction object referenced by intParentAssetTransactionId // @return AssetTransaction try { if (!$this->objParentAssetTransaction && !is_null($this->intParentAssetTransactionId)) { $this->objParentAssetTransaction = AssetTransaction::Load($this->intParentAssetTransactionId); } return $this->objParentAssetTransaction; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'SourceLocation': // Gets the value for the Location object referenced by intSourceLocationId // @return Location try { if (!$this->objSourceLocation && !is_null($this->intSourceLocationId)) { $this->objSourceLocation = Location::Load($this->intSourceLocationId); } return $this->objSourceLocation; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'DestinationLocation': // Gets the value for the Location object referenced by intDestinationLocationId // @return Location try { if (!$this->objDestinationLocation && !is_null($this->intDestinationLocationId)) { $this->objDestinationLocation = Location::Load($this->intDestinationLocationId); } return $this->objDestinationLocation; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'NewAsset': // Gets the value for the Asset object referenced by intNewAssetId // @return Asset try { if (!$this->objNewAsset && !is_null($this->intNewAssetId)) { $this->objNewAsset = Asset::Load($this->intNewAssetId); } return $this->objNewAsset; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'CreatedByObject': // Gets the value for the UserAccount object referenced by intCreatedBy // @return UserAccount try { if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) { $this->objCreatedByObject = UserAccount::Load($this->intCreatedBy); } return $this->objCreatedByObject; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'ModifiedByObject': // Gets the value for the UserAccount object referenced by intModifiedBy // @return UserAccount try { if (!$this->objModifiedByObject && !is_null($this->intModifiedBy)) { $this->objModifiedByObject = UserAccount::Load($this->intModifiedBy); } return $this->objModifiedByObject; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } case 'AssetTransactionCheckout': // Gets the value for the AssetTransactionCheckout object that uniquely references this AssetTransaction // by objAssetTransactionCheckout (Unique) // @return AssetTransactionCheckout try { if ($this->objAssetTransactionCheckout === false) { // We've attempted early binding -- and the reverse reference object does not exist return null; } if (!$this->objAssetTransactionCheckout) { $this->objAssetTransactionCheckout = AssetTransactionCheckout::LoadByAssetTransactionId($this->intAssetTransactionId); } return $this->objAssetTransactionCheckout; } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// //////////////////////////// // Virtual Object References (Many to Many and Reverse References) // (If restored via a "Many-to" expansion) //////////////////////////// case '_ChildAssetTransaction': // Gets the value for the private _objChildAssetTransaction (Read-Only) // if set due to an expansion on the asset_transaction.parent_asset_transaction_id reverse relationship // @return AssetTransaction return $this->_objChildAssetTransaction; case '_ChildAssetTransactionArray': // Gets the value for the private _objChildAssetTransactionArray (Read-Only) // if set due to an ExpandAsArray on the asset_transaction.parent_asset_transaction_id reverse relationship // @return AssetTransaction[] return (array) $this->_objChildAssetTransactionArray; case '__Restored': return $this->__blnRestored; default: try { return parent::__get($strName); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } } }