Exemplo n.º 1
0
    /**
     * Deletes all associated QueryConditions
     * @return void
     */
    public function DeleteAllQueryConditions()
    {
        if (is_null($this->intId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateQueryCondition on this unsaved QueryOperation.');
        }
        // Get the Database Object for this Class
        $objDatabase = QueryOperation::GetDatabase();
        // Journaling
        if ($objDatabase->JournalingDatabase) {
            foreach (QueryCondition::LoadArrayByQueryOperationId($this->intId) as $objQueryCondition) {
                $objQueryCondition->Journal('DELETE');
            }
        }
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`query_condition`
				WHERE
					`query_operation_id` = ' . $objDatabase->SqlVariable($this->intId) . '
			');
    }