mjacobus/php-query-builder

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

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace PO\QueryBuilder\Clauses;

/**
 * @author Marcelo Jacobus <marcelo.jacobus@gmail.com>
 */
class LimitClause extends Base
{
    /**
     * Return the resulting query
     * @return string
     */
    public function toSql()
    {
        if ($this->isEmpty()) {
            return '';
        } else {
            return 'LIMIT ' . implode(', ', $this->getParams());
        }
    }
}