Объединение условий
@param $cond1
@param $cond2
@param bool $or
184343
static function unionCond($cond1, $cond2, $or = false)
    {
        foreach ($cond2 as $key => $param){
            if (!isset($cond1[$key])){
                $cond1[$key] = $param;
            }else
            if ($key == 'order'){
                $cond1[$key] = array_merge($cond1[$key], $param);
            }else
            if ($key == 'where'){
                $cond1[$key] = self::unionCondWhere($cond1[$key], $param, $or);
            }
        }
        return $cond1;
    }
354890
public function fullOuterJoin($table, $alias_or_cond, $cond = null) {
		if (is_null($cond))
			$this->joins[] = new JoinClause(JoinClause::FULL_OUTER_JOIN, $table, null, $alias_or_cond);
		else
			$this->joins[] = new JoinClause(JoinClause::FULL_OUTER_JOIN, $table, $alias_or_cond, $cond);
		return $this;
	}
430632
public function update($table, array $row, $cond=null)
	{
		return Sql::assistant( $this->ds )->update($table, $row, $cond);
	}
817710
public function on($column1, $column2 = null, $operator = '=')
    {
        return $this->addJoinCondition($column1, $column2, $operator);
    }
839888
public function searchAll(array $cond = array(), $order = false): array
    {
        $options = array(
            'order' => $order,
            'count' => 0,
            'offset' => 0
        );

        $result = $this->search($cond, $options);

        return $result->getAllResults();
    }
95393
public function update($table, array $row, $cond=null)
	{
		$ds = $this->ds();
		if ( empty($row) ) return false;
		
        list($pairs, $values) = SqlHelper::placeholder_pair($row);
        $pairs = implode(',', $pairs);
        
        $table = SqlHelper::qtable($table);
		
        $sql = SqlHelper::bind($ds, "UPDATE {$table} SET {$pairs}", $row);
        
        $cond = SqlHelper::parse_cond($ds, $cond);
        if ($cond) $sql .= " WHERE {$cond}";
        
        $result = Sql::write($ds, Sql::MODE_WRITE_UPDATE, [
			 $sql
		]);
		return $result;
	}
1003985
func (gt Gt) Or(conds ...Cond) Cond {
	return Or(gt, Or(conds...))
}
720569
final public function join($table, $cond, $type = 'LEFT')
    {

        if ($type != '') {
            $type = strtoupper(trim($type));

            if (!in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'))) {
                $type = '';
            } else {
                $type .= ' ';
            }
        }
        // Extract any aliases that might exist.  We use this information
        // in the _protect_identifiers to know whether to add a table prefix
        $this->traceTableAlias($table);

        // Strip apart the condition and protect the identifiers
        if (preg_match('/([\w\.]+)([\W\s]+)(.+)/', $cond, $match)) {
            $match[1] = $this->identifiers($match[1]);
            $match[3] = $this->identifiers($match[3]);

            $cond = $match[1] . $match[2] . $match[3];
        }
        // Assemble the JOIN statement
        $join = $type . 'JOIN ' . $this->identifiers($table) . ' ON ' . $cond;

        $this->arrayJoin[] = $join;
        if ($this->arrayCaching === TRUE) {
            $this->arrayCacheJoin[] = $join;
            $this->arrayCacheExists[] = 'join';
        }

        return $this;
    }
1264474
public function orWhere($first, $operator = null, $second = null)
	{
		return $this->on($first, $operator, $second, 'or', true);
	}
1146445
public static function _or(/* ... */) {
        $args = func_get_args();
        return function ($features) use ($args) {
            $acc = false;
            foreach ($args as $arg)
                $acc = $acc || $arg($features);
            return $acc;
        };
    }
365956
public function andOn($column1, $column2 = null, $operator = '=')
    {
        return $this->addJoinCondition($column1, $column2, $operator, 'AND');
    }
345747
func (lte Lte) Or(conds ...Cond) Cond {
	return Or(lte, Or(conds...))
}
526528
public function between($column, $value1, $value2, $logicalAnd = true) {
        $this->customWhere('`:TBL:`.`' . Util::camelTo_($column) . '` BETWEEN "'
                . $value1 . '" AND "' . $value2 . '" ',
                $logicalAnd ? 'AND' : 'OR');
    }
143968
function(cond){
    var test = cond.test;
    this.buf.push('if (' + test + ') {');
    this.visit(cond.consequent, cond);
    this.buf.push('}')
    if (cond.alternate) {
      if (cond.alternate.type === 'Conditional') {
        this.buf.push('else')
        this.visitConditional(cond.alternate);
      } else {
        this.buf.push('else {');
        this.visit(cond.alternate, cond);
        this.buf.push('}');
      }
    }
  }
1117036
public function between($item, $low, $up, $cond = null, $not = false)
    {
        $bClause = '';

        if (null == $this->oosql_where && null == $this->oosql_between && null == $this->oosql_in) {
            $bClause .= ' WHERE ';
        } else {
            $cnd = ' AND ';

            if (null != $cond) {

                if (strtolower($cond) == 'or') {
                    $cnd = ' OR ';
                }

            }
            $bClause .= $cnd;
        }

        if ($not) {
            $item = $item . ' NOT ';
        }
        $bClause .= $item . ' BETWEEN ' . $low . ' AND ' . $up;

        $this->oosql_between = $bClause;

        return $this;
    }
422274
public function where($condition, $value = null, $type = null)
    {

        switch ($type) {
            case null:
                $clause = 'WHERE';
                break;
            case 'or':
                $clause = 'OR';
                break;
            case 'and':
                $clause = 'AND';
                break;
            default:
                $clause = 'WHERE';
        }

        $this->oosql_where .= " $clause $condition";

        if ($value instanceof oosql) {

            $this->oosql_where .= $value->getSql();
        } elseif (null !== $value) {

            $this->oosql_conValues[] = $value;
        }

        return $this;
    }
1187994
public static Restriction or(Restriction r1, Restriction r2) {
        return new Or(Arrays.asList(r1, r2));
    }