mjacobus/php-query-builder

View on GitHub
lib/PO/QueryBuilder/Clauses/GroupClause.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace PO\QueryBuilder\Clauses;

/**
 * @author Marcelo Jacobus <marcelo.jacobus@gmail.com>
 */
class GroupClause extends Base
{

    /**
     * Return the resulting query
     * @return string
     */
    public function toSql()
    {
        if ($this->isEmpty()) {
            return '';
        } else {
            return 'GROUP BY ' . implode(', ', $this->getParams());
        }
    }
}