for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Muffin\Queries\Snippets;
use Muffin\Snippet;
class GroupBy implements Snippet
{
private
$groupBy;
public function __construct()
$this->groupBy = array();
}
public function addGroupBy($column)
if(!empty($column))
$this->groupBy[$column] = $column;
return $this;
public function toString()
if(empty($this->groupBy))
return '';
return sprintf('GROUP BY %s', implode(', ', $this->groupBy));