public function in($column)
    {
        $args = func_get_args();

        if (count($args) < 2) {
            throw new QueryException('Expected two or more parameters to in()');
        }

        if (is_array($args[1])) {
            $values = array_values($args[1]);
        } else {
            $values = array_slice($args, 1);
        }

        // Special handling of sub selects to avoid double braces
        if (count($values) === 1 && $values[0] instanceof SubselectDoctrineQuery) {
            return "{$column} IN " . $values[0]->getQuery();
        }

        if (count($values) == 0) {
            throw new QueryException('At least one element is required as value.');
        }

        foreach ($values as $key => $value) {
            switch (true) {
                case $value instanceof SubselectDoctrineQuery:
                    $values[$key] = $value->getQuery();
                    break;
                case is_int($value):
                case is_float($value):
                    $values[$key] = (string)$value;
                    break;
                default:
                    $values[$key] = $this->connection->quote($value);
            }
        }

        return "{$column} IN ( " . implode(', ', $values) . ' )';
    }
public function in($column)
    {
        $args = func_get_args();

        if (count($args) < 2) {
            throw new QueryException('Expected two or more parameters to in()');
        }

        if (is_array($args[1])) {
            $values = array_values($args[1]);
        } else {
            $values = array_slice($args, 1);
        }

        // Special handling of sub selects to avoid double braces
        if (count($values) === 1 && $values[0] instanceof SubselectDoctrineQuery) {
            return "{$column} IN " . $values[0]->getQuery();
        }

        if (count($values) == 0) {
            throw new QueryException('At least one element is required as value.');
        }

        foreach ($values as $key => $value) {
            switch (true) {
                case $value instanceof SubselectDoctrineQuery:
                    $values[$key] = $value->getQuery();
                    break;
                case is_int($value):
                case is_float($value):
                    $values[$key] = (string)$value;
                    break;
                default:
                    $values[$key] = $this->connection->quote($value);
            }
        }

        return "{$column} IN ( " . implode(', ', $values) . ' )';
    }
public function in ( $ column ) { $ args = func_get_args ( ) ; if ( count ( $ args ) < 2 ) { throw new QueryException ( 'Expected two or more parameters to in()' ) ; } if ( is_array ( $ args [ 1 ] ) ) { $ values = array_values ( $ args [ 1 ] ) ; } else { $ values = array_slice ( $ args , 1 ) ; } // Special handling of sub selects to avoid double braces if ( count ( $ values ) === 1 && $ values [ 0 ] instanceof SubselectDoctrineQuery ) { return "{$column} IN " . $ values [ 0 ] -> getQuery ( ) ; } if ( count ( $ values ) == 0 ) { throw new QueryException ( 'At least one element is required as value.' ) ; } foreach ( $ values as $ key => $ value ) { switch ( true ) { case $ value instanceof SubselectDoctrineQuery : $ values [ $ key ] = $ value -> getQuery ( ) ; break ; case is_int ( $ value ) : case is_float ( $ value ) : $ values [ $ key ] = ( string ) $ value ; break ; default : $ values [ $ key ] = $ this -> connection -> quote ( $ value ) ; } } return "{$column} IN ( " . implode ( ', ' , $ values ) . ' )' ; }
Returns the SQL to check if a value is one in a set of
given values..

in() accepts an arbitrary number of parameters. The first parameter
must always specify the value that should be matched against. Successive
parameters must contain a logical expression or an array with logical
expressions.  These expressions will be matched against the first
parameter.

Example:
<code>
$q->select( '*' )->from( 'table' )
->where( $q->expr->in( 'id', 1, 2, 3 ) );
</code>

@throws \eZ\Publish\Core\Persistence\Database\QueryException if called with less than two
parameters.
@throws \eZ\Publish\Core\Persistence\Database\QueryException if the 2nd parameter is an
empty array.

@param string $column the value that should be matched against
@param string|array(string) $... values that will be matched against $column

@return string logical expression
Returns the SQL to check if a value is one in a set of given values ..