/** * Deletes all associated InventoryModelsAsCreatedBy * @return void */ public function DeleteAllInventoryModelsAsCreatedBy() { if (is_null($this->intUserAccountId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateInventoryModelAsCreatedBy on this unsaved UserAccount.'); } // Get the Database Object for this Class $objDatabase = UserAccount::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (InventoryModel::LoadArrayByCreatedBy($this->intUserAccountId) as $objInventoryModel) { $objInventoryModel->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `inventory_model` WHERE `created_by` = ' . $objDatabase->SqlVariable($this->intUserAccountId) . ' '); }
/** * Gets all associated InventoryModelsAsCreatedBy as an array of InventoryModel objects * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query * @return InventoryModel[] */ public function GetInventoryModelAsCreatedByArray($objOptionalClauses = null) { if (is_null($this->intUserAccountId)) { return array(); } try { return InventoryModel::LoadArrayByCreatedBy($this->intUserAccountId, $objOptionalClauses); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }