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