Ejemplo n.º 1
0
    /**
     * Deletes an associated StewardshipBatchAsCreatedBy
     * @param StewardshipBatch $objStewardshipBatch
     * @return void
     */
    public function DeleteAssociatedStewardshipBatchAsCreatedBy(StewardshipBatch $objStewardshipBatch)
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipBatchAsCreatedBy on this unsaved Login.');
        }
        if (is_null($objStewardshipBatch->Id)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateStewardshipBatchAsCreatedBy on this Login with an unsaved StewardshipBatch.');
        }
        // Get the Database Object for this Class
        $objDatabase = Login::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`stewardship_batch`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($objStewardshipBatch->Id) . ' AND
					`created_by_login_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            $objStewardshipBatch->Journal('DELETE');
        }
    }