/** * Deletes all associated StewardshipPosts * @return void */ public function DeleteAllStewardshipPosts() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipPost on this unsaved StewardshipBatch.'); } // Get the Database Object for this Class $objDatabase = StewardshipBatch::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (StewardshipPost::LoadArrayByStewardshipBatchId($this->intId) as $objStewardshipPost) { $objStewardshipPost->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `stewardship_post` WHERE `stewardship_batch_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }