Beispiel #1
0
    /**
     * Deletes all associated SignupProducts
     * @return void
     */
    public function DeleteAllSignupProducts()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateSignupProduct on this unsaved FormProduct.');
        }
        // Get the Database Object for this Class
        $objDatabase = FormProduct::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (SignupProduct::LoadArrayByFormProductId($this->intId) as $objSignupProduct) {
                $objSignupProduct->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`signup_product`
				WHERE
					`form_product_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }