Пример #1
0
    /**
     * Deletes an associated NotificationUserAccount
     * @param NotificationUserAccount $objNotificationUserAccount
     * @return void
     */
    public function DeleteAssociatedNotificationUserAccount(NotificationUserAccount $objNotificationUserAccount)
    {
        if (is_null($this->intNotificationId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateNotificationUserAccount on this unsaved Notification.');
        }
        if (is_null($objNotificationUserAccount->NotificationUserAccountId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateNotificationUserAccount on this Notification with an unsaved NotificationUserAccount.');
        }
        // Get the Database Object for this Class
        $objDatabase = Notification::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`notification_user_account`
				WHERE
					`notification_user_account_id` = ' . $objDatabase->SqlVariable($objNotificationUserAccount->NotificationUserAccountId) . ' AND
					`notification_id` = ' . $objDatabase->SqlVariable($this->intNotificationId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objNotificationUserAccount->Journal('DELETE');
        }
    }