Пример #1
0
    /**
     * Deletes all associated InventoryLocationsAsModifiedBy
     * @return void
     */
    public function DeleteAllInventoryLocationsAsModifiedBy()
    {
        if (is_null($this->intUserAccountId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateInventoryLocationAsModifiedBy on this unsaved UserAccount.');
        }
        // Get the Database Object for this Class
        $objDatabase = UserAccount::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (InventoryLocation::LoadArrayByModifiedBy($this->intUserAccountId) as $objInventoryLocation) {
                $objInventoryLocation->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`inventory_location`
				WHERE
					`modified_by` = ' . $objDatabase->SqlVariable($this->intUserAccountId) . '
			');
    }
Пример #2
0
 /**
  * Gets all associated InventoryLocationsAsModifiedBy as an array of InventoryLocation objects
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @return InventoryLocation[]
  */
 public function GetInventoryLocationAsModifiedByArray($objOptionalClauses = null)
 {
     if (is_null($this->intUserAccountId)) {
         return array();
     }
     try {
         return InventoryLocation::LoadArrayByModifiedBy($this->intUserAccountId, $objOptionalClauses);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }