/** * Deletes an associated GrowthGroup * @param GrowthGroup $objGrowthGroup * @return void */ public function DeleteAssociatedGrowthGroup(GrowthGroup $objGrowthGroup) { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateGrowthGroup on this unsaved GrowthGroupLocation.'); } if (is_null($objGrowthGroup->GroupId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateGrowthGroup on this GrowthGroupLocation with an unsaved GrowthGroup.'); } // Get the Database Object for this Class $objDatabase = GrowthGroupLocation::GetDatabase(); // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `growth_group` WHERE `group_id` = ' . $objDatabase->SqlVariable($objGrowthGroup->GroupId) . ' AND `growth_group_location_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); // Journaling if ($objDatabase->JournalingDatabase) { $objGrowthGroup->Journal('DELETE'); } }