src/Compiler/Union.php
public static function render(Query\Union $query)
    {
        return Compiler::withDb($query->getDb(), function () use ($query) {
            return Compiler::expression(array(
                Arr::join(' UNION ', Arr::map(function (Query\Select $select) {
                    return Compiler::braced(Select::render($select));
                }, $query->getSelects())),
                Compiler::word('ORDER BY', Direction::combine($query->getOrder())),
                Compiler::word('LIMIT', $query->getLimit()),
            ));
        });
    }
public static function render(Query\Union $query)
    {
        return Compiler::withDb($query->getDb(), function () use ($query) {
            return Compiler::expression(array(
                Arr::join(' UNION ', Arr::map(function (Query\Select $select) {
                    return Compiler::braced(Select::render($select));
                }, $query->getSelects())),
                Compiler::word('ORDER BY', Direction::combine($query->getOrder())),
                Compiler::word('LIMIT', $query->getLimit()),
            ));
        });
    }
public static function render ( Query \ Union $ query ) { return Compiler :: withDb ( $ query -> getDb ( ) , function ( ) use ( $ query ) { return Compiler :: expression ( array ( Arr :: join ( ' UNION ' , Arr :: map ( function ( Query \ Select $ select ) { return Compiler :: braced ( Select :: render ( $ select ) ) ; } , $ query -> getSelects ( ) ) ) , Compiler :: word ( 'ORDER BY' , Direction :: combine ( $ query -> getOrder ( ) ) ) , Compiler :: word ( 'LIMIT' , $ query -> getLimit ( ) ) , ) ) ; } ) ; }
Render a Union object
@param  Query\Union $query
@return string
Render a Union object