framework/db/conditions/InConditionBuilder.php
protected function buildCompositeInCondition($operator, $columns, $values, &$params)
    {
        $vss = [];
        foreach ($values as $value) {
            $vs = [];
            foreach ($columns as $column) {
                if (isset($value[$column])) {
                    $vs[] = $this->queryBuilder->bindParam($value[$column], $params);
                } else {
                    $vs[] = 'NULL';
                }
            }
            $vss[] = '(' . implode(', ', $vs) . ')';
        }

        if (empty($vss)) {
            return $operator === 'IN' ? '0=1' : '';
        }

        $sqlColumns = [];
        foreach ($columns as $i => $column) {
            $sqlColumns[] = strpos($column, '(') === false ? $this->queryBuilder->db->quoteColumnName($column) : $column;
        }

        return '(' . implode(', ', $sqlColumns) . ") $operator (" . implode(', ', $vss) . ')';
    }
protected function buildCompositeInCondition($operator, $columns, $values, &$params)
    {
        $vss = [];
        foreach ($values as $value) {
            $vs = [];
            foreach ($columns as $column) {
                if (isset($value[$column])) {
                    $vs[] = $this->queryBuilder->bindParam($value[$column], $params);
                } else {
                    $vs[] = 'NULL';
                }
            }
            $vss[] = '(' . implode(', ', $vs) . ')';
        }

        if (empty($vss)) {
            return $operator === 'IN' ? '0=1' : '';
        }

        $sqlColumns = [];
        foreach ($columns as $i => $column) {
            $sqlColumns[] = strpos($column, '(') === false ? $this->queryBuilder->db->quoteColumnName($column) : $column;
        }

        return '(' . implode(', ', $sqlColumns) . ") $operator (" . implode(', ', $vss) . ')';
    }
protected function buildCompositeInCondition ( $ operator , $ columns , $ values , & $ params ) { $ vss = [ ] ; foreach ( $ values as $ value ) { $ vs = [ ] ; foreach ( $ columns as $ column ) { if ( isset ( $ value [ $ column ] ) ) { $ vs [ ] = $ this -> queryBuilder -> bindParam ( $ value [ $ column ] , $ params ) ; } else { $ vs [ ] = 'NULL' ; } } $ vss [ ] = '(' . implode ( ', ' , $ vs ) . ')' ; } if ( empty ( $ vss ) ) { return $ operator === 'IN' ? '0=1' : '' ; } $ sqlColumns = [ ] ; foreach ( $ columns as $ i => $ column ) { $ sqlColumns [ ] = strpos ( $ column , '(' ) === false ? $ this -> queryBuilder -> db -> quoteColumnName ( $ column ) : $ column ; } return '(' . implode ( ', ' , $ sqlColumns ) . ") $operator (" . implode ( ', ' , $ vss ) . ')' ; }
Builds SQL for IN condition.

@param string $operator
@param array|\Traversable $columns
@param array $values
@param array $params
@return string SQL
Builds SQL for IN condition .