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