/** * Unassociates all GrowthGroups * @return void */ public function UnassociateAllGrowthGroups() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateAllGrowthGroupArray on this unsaved GrowthGroupStructure.'); } // Get the Database Object for this Class $objDatabase = GrowthGroupStructure::GetDatabase(); // Journaling (if applicable) if ($objDatabase->JournalingDatabase) { $objResult = $objDatabase->Query('SELECT `growth_group_id` AS associated_id FROM `growthgroupstructure_growthgroup_assn` WHERE `growth_group_structure_id` = ' . $objDatabase->SqlVariable($this->intId)); while ($objRow = $objResult->GetNextRow()) { $this->JournalGrowthGroupAssociation($objRow->GetColumn('associated_id'), 'DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `growthgroupstructure_growthgroup_assn` WHERE `growth_group_structure_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }