示例#1
0
    /**
     * Deletes an associated FormProduct
     * @param FormProduct $objFormProduct
     * @return void
     */
    public function DeleteAssociatedFormProduct(FormProduct $objFormProduct)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateFormProduct on this unsaved SignupForm.');
        }
        if (is_null($objFormProduct->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateFormProduct on this SignupForm with an unsaved FormProduct.');
        }
        // Get the Database Object for this Class
        $objDatabase = SignupForm::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`form_product`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objFormProduct->Id) . ' AND
					`signup_form_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objFormProduct->Journal('DELETE');
        }
    }