Ejemplo n.º 1
0
    /**
     * Deletes all associated StewardshipStacks
     * @return void
     */
    public function DeleteAllStewardshipStacks()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipStack on this unsaved StewardshipBatch.');
        }
        // Get the Database Object for this Class
        $objDatabase = StewardshipBatch::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (StewardshipStack::LoadArrayByStewardshipBatchId($this->intId) as $objStewardshipStack) {
                $objStewardshipStack->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`stewardship_stack`
				WHERE
					`stewardship_batch_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }