Ejemplo n.º 1
0
    /**
     * Deletes all associated EmailMessageRoutes
     * @return void
     */
    public function DeleteAllEmailMessageRoutes()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateEmailMessageRoute on this unsaved Login.');
        }
        // Get the Database Object for this Class
        $objDatabase = Login::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (EmailMessageRoute::LoadArrayByLoginId($this->intId) as $objEmailMessageRoute) {
                $objEmailMessageRoute->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`email_message_route`
				WHERE
					`login_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }