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