@param ShouldQuery $should

@return $this
487238
public function setShould(ShouldQuery $should)
    {
        $this->result = array_merge($this->result, $should->toArray()['bool']);

        return $this;
    }
1137448
public function startGroup($logicalAnd = true) {
        if ($this->where)
                $this->where .= ' ' . ($logicalAnd ? 'AND' : 'OR') . ' (';
        else $this->where = ' WHERE (';

        return $this;
    }
1250094
public function orHaving(...$conditions) : self
    {
        $this->havingConditions = $this->conditionalQueryBuilder->addConditionToClause(
            $this->havingConditions, 'OR', ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }
1333265
protected function addWhereConstraints()
    {
        $this->query->where(
            $this->getQualifiedForeignKeyName(), '=', $this->parent->getKey()
        );

        return $this;
    }
137394
public function on($first, $operator, $second, $boolean = 'and', $where = false)
    {
        $this->clauses[] = compact('first', 'operator', 'second', 'boolean', 'where');

        if ($where) $this->bindings[] = $second;

        return $this;
    }
113448
public function in($haystack, $identical = false)
    {
        $this->addCondition(__METHOD__, [$haystack, $identical]);

        return $this;
    }
1261353
public function whenEmpty($other): self
    {
        if (!$this->isEmpty($this->value)) {
            return $this;
        }

        return self::of($other);
    }
962105
public function whereExists($name, $exists = true)
    {

        if ($exists) {
            $this->must[] = ["exists" => ["field" => $name]];
        } else {
            $this->must_not[] = ["exists" => ["field" => $name]];
        }

        return $this;
    }
514972
public function forWhere($cond, $bind = null)
    {
        $this->sql_select->where($cond, $bind);

        return $this;
    }
628866
public function setExpectedResult($expected = Table::RETURN_MODEL,
            $checkNotSet = false) {
        if (!$checkNotSet || ($checkNotSet && is_null($this->expected)))
                $this->expected = $expected;
        return $this;
    }
1113273
public function setQuery($query)
    {
        $this->query = null;
        if (is_string($query)) {
            $this->query = ltrim($query, '?');
        }
        return $this;
    }
1280250
final protected function flock($operation = LOCK_EX, &$wouldblock = 0)
	{
		$this->flocked = flock($this->fhandle, $operation, $wouldblock);
		return $this;
	}
1073272
protected function setWhere()
    {
        $foreign = $this->getForeignKey();

        $this->query->where($foreign, '=', $this->parent->getKey());

        return $this;
    }
401323
public function when($condition, $query, $otherwise = null)
    {
        if ($condition instanceof \Closure) {
            $condition = $condition($this);
        }

        if ($condition) {
            if ($query instanceof \Closure) {
                $query($this, $condition);
            } elseif (is_array($query)) {
                $this->where($query);
            }
        } elseif ($otherwise) {
            if ($otherwise instanceof \Closure) {
                $otherwise($this, $condition);
            } elseif (is_array($otherwise)) {
                $this->where($otherwise);
            }
        }

        return $this;
    }
458837
function add(Expr $next) {
		if ($this->isNull()) {
			throw new \UnexpectedValueException("Cannot add anything to NULL");
		}
		if ($this->next) {
			$this->next->add($next);
		} else {
			$this->next = $next;
		}
		return $this;
	}
172534
public function set($data=null, $where=null)
    {
        if ($data)  {
            $this->getQuery()->set('data', $data);
        }
        if ($where) {
            $this->where($where);
        }
        
        return $this;
    }
1289285
public function with(...$with): self
    {
        $this->hasWith = true;
        $this->with = $with;

        return $this;
    }