Esempio n. 1
0
    /**
     * Deletes an associated CommunicationList
     * @param CommunicationList $objCommunicationList
     * @return void
     */
    public function DeleteAssociatedCommunicationList(CommunicationList $objCommunicationList)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateCommunicationList on this unsaved Ministry.');
        }
        if (is_null($objCommunicationList->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateCommunicationList on this Ministry with an unsaved CommunicationList.');
        }
        // Get the Database Object for this Class
        $objDatabase = Ministry::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`communication_list`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objCommunicationList->Id) . ' AND
					`ministry_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objCommunicationList->Journal('DELETE');
        }
    }