ManaPHP\Mvc\Model\QueryBuilder::andWhere PHP Метод

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

$builder->andWhere('name = "Peter"'); $builder->andWhere('name = :name: AND id > :id:', array('name' => 'Peter', 'id' => 100));
public andWhere ( string $conditions, integer | float | string | array $bind = [] ) : static
$conditions string
$bind integer | float | string | array
Результат static
    public function andWhere($conditions, $bind = [])
    {
        if (is_scalar($bind)) {
            $conditions = trim($conditions);
            if (!Text::contains($conditions, ' ')) {
                $conditions .= ' =';
            }
            $parts = explode(' ', $conditions, 2);
            $conditions = preg_replace('#[a-z_][a-z0-9_]*#i', '[\\0]', $parts[0]) . ' ' . $parts[1];
            $column = str_replace('.', '_', $parts[0]);
            /** @noinspection CascadeStringReplacementInspection */
            $from = ['`', '[', ']'];
            $column = str_replace($from, '', $column);
            $conditions = $conditions . ' :' . $column;
            $bind = [$column => $bind];
        }
        $this->_conditions[] = $conditions;
        $this->_bind = array_merge($this->_bind, $bind);
        return $this;
    }