Skip to content
Snippets Groups Projects
Commit 8497a70a authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Sql_lib: .clearWhere completely resets the condition

parent 2f3c9bb1
No related branches found
No related tags found
No related merge requests found
......@@ -790,18 +790,8 @@ function SqlBuilder (pAlias)
this._subselectAlias = null;
this._where = {
preparedValues: [],
_sqlStorage: "",
// save, if the last condition was an OR. For better bracket-placement
_lastWasOr: false,
// also for better bracket-placement
_previouslyOnlyOr: false,
// where has always to be called first for a better semantic
_whereWasCalled: false
}
this._where = {};
this._initWhere();
}
/**
......@@ -1995,10 +1985,22 @@ SqlBuilder.prototype.isFullSelect = function()
* @return {SqlBuilder} current SqlBuilder object
*/
SqlBuilder.prototype.clearWhere = function()
{
this._initWhere();
return this;
}
/**
* function that initializes the properties of the ._where object, this is used in the
* constructor and .clearWhere
*/
SqlBuilder.prototype._initWhere = function ()
{
this._where._sqlStorage = "";
this._where.preparedValues = [];
return this;
this._where._lastWasOr = false; // save, if the last condition was an OR. For better bracket-placement
this._where._previouslyOnlyOr = false; // also for better bracket-placement
this._where._whereWasCalled = false; // where has always to be called first for a better semantic
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment