/** * Compile a "between" where clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereBetween(Builder query, WhereOptions where) { string between = where.not ? "not between" : "between"; string str = this.wrap(where.column) + " " + between + " ? and ?"; return(this.wrap(where.column) + " " + between + " ? and ?"); }
/** * Compile a "where not in" clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereNotIn(Builder query, WhereOptions where) { if (where.values.Length == 0) { return("1 = 1"); } string values = this.parameterize(where.values); return(this.wrap(where.column) + " not in (" + values + ")"); }
public static WhereToken Create(WhereOperator op, string fieldName, string parameterName, WhereOptions options = null) { return(new WhereToken { FieldName = fieldName, ParameterName = parameterName, WhereOperator = op, Options = options ?? WhereOptions.Default() }); }
/** * Compile a "where date" clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected override string whereDate(Builder query, WhereOptions where) { string value = this.parameter(where.value); return("cast(" + this.wrap(where.column) + " as date) " + where.operator1 + " " + value); }
/** * Compile a raw where clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereRaw(Builder query, WhereOptions where) { return(where.sql); }
/** * Compile a date based where clause. * * @param string $type * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string dateBasedWhere(string type, Builder query, WhereOptions where) { string value = this.parameter(where.value); return(type + "(" + this.wrap(where.column) + ") " + where.operator1 + " " + value); }
/** * Compile a "where year" clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereYear(Builder query, WhereOptions where) { return(this.dateBasedWhere("year", query, where)); }
/** * Compile a "where month" clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereMonth(Builder query, WhereOptions where) { return(this.dateBasedWhere("month", query, where)); }
/** * Compile a "where day" clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereDay(Builder query, WhereOptions where) { return(this.dateBasedWhere("day", query, where)); }
/** * Compile a "where not null" clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereNotNull(Builder query, WhereOptions where) { return(this.wrap(where.column) + " is not null"); }
/** * Compile a where not in sub-select clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereNotInSub(Builder query, WhereOptions where) { string select = this.compileSelect(where.query); return(this.wrap(where.column) + " not in (" + select + ")"); }
/** * Compile a where exists clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereNotExists(Builder query, WhereOptions where) { return("not exists (" + this.compileSelect(where.query) + ")"); }
/** * Compile a basic where clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereBasic(Builder query, WhereOptions where) { string value = this.parameter(where.value); return(this.wrap(where.column) + " " + where.operator1 + " " + value); }
/** * Compile a where condition with a sub-select. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereSub(Builder query, WhereOptions where) { string select = this.compileSelect(where.query); return(this.wrap(where.column) + " " + where.operator1 + " (" + select + ")"); }
/** * Compile a nested where clause. * * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */ protected virtual string whereNested(Builder query, WhereOptions where) { Builder nested = where.query; return("(" + this.compileWheres(nested).Substring(6) + ")"); }