2013-09-03 22:25:54 -04:00
|
|
|
(function(define) {
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
// JoinClause
|
|
|
|
// ---------
|
|
|
|
define(function(require, exports) {
|
|
|
|
|
|
|
|
var JoinClause = function(type, table) {
|
2013-09-05 16:36:49 -04:00
|
|
|
this.type = type;
|
|
|
|
this.table = table;
|
2013-09-08 15:57:32 -04:00
|
|
|
this.clauses = [];
|
2013-09-03 22:25:54 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
JoinClause.prototype = {
|
|
|
|
|
|
|
|
on: function(first, operator, second) {
|
|
|
|
this.clauses.push({first: first, operator: operator, second: second, bool: 'and'});
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
|
|
|
andOn: function() {
|
|
|
|
return this.on.apply(this, arguments);
|
|
|
|
},
|
|
|
|
|
|
|
|
orOn: function(first, operator, second) {
|
|
|
|
this.clauses.push({first: first, operator: operator, second: second, bool: 'or'});
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.JoinClause = JoinClause;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})(
|
|
|
|
typeof define === 'function' && define.amd ? define : function (factory) { factory(require, exports); }
|
|
|
|
);
|