/** * Deletes all associated StewardshipBatchesAsCreatedBy * @return void */ public function DeleteAllStewardshipBatchesAsCreatedBy() { if (is_null($this->intId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipBatchAsCreatedBy on this unsaved Login.'); } // Get the Database Object for this Class $objDatabase = Login::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (StewardshipBatch::LoadArrayByCreatedByLoginId($this->intId) as $objStewardshipBatch) { $objStewardshipBatch->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `stewardship_batch` WHERE `created_by_login_id` = ' . $objDatabase->SqlVariable($this->intId) . ' '); }