Nette\Database\Table\Selection::condition PHP Метод

condition() защищенный Метод

Adds condition, more calls appends with AND.
protected condition ( $condition, array $params, $tableChain = NULL ) : void
$params array
Результат void
    protected function condition($condition, array $params, $tableChain = NULL)
    {
        $this->emptyResultSet();
        if (is_array($condition) && $params === []) {
            // where(array('column1' => 1, 'column2 > ?' => 2))
            foreach ($condition as $key => $val) {
                if (is_int($key)) {
                    $this->condition($val, [], $tableChain);
                    // where('full condition')
                } else {
                    $this->condition($key, [$val], $tableChain);
                    // where('column', 1)
                }
            }
        } elseif ($tableChain) {
            $this->sqlBuilder->addJoinCondition($tableChain, $condition, ...$params);
        } else {
            $this->sqlBuilder->addWhere($condition, ...$params);
        }
    }