Bluz\Db\Query\Traits\Where::andWhere PHP Метод

andWhere() публичный Метод

. AND .. condition Adds one or more restrictions to the query results, forming a logical conjunction with any previously specified restrictions. $sb = new SelectBuilder(); $sb ->select('u') ->from('users', 'u') ->where('u.username LIKE ?', '%Smith%') ->andWhere('u.is_active = ?', 1);
public andWhere ( $condition )
$condition Optional the query restriction predicates
    public function andWhere(...$condition)
    {
        $condition = $this->prepareCondition($condition);
        $where = $this->getQueryPart('where');
        if ($where instanceof CompositeBuilder && $where->getType() == 'AND') {
            $where->add($condition);
        } else {
            $where = new CompositeBuilder([$where, $condition]);
        }
        return $this->addQueryPart('where', $where, false);
    }