Offer the possibility to override internal formatter objects from plugins

This commit is contained in:
Frederic Guillot
2016-12-20 20:06:39 -05:00
parent a957195952
commit ae708a712a
28 changed files with 200 additions and 72 deletions

View File

@@ -12,36 +12,26 @@ use PicoDb\Table;
* @package formatter
* @author Frederic Guillot
*/
class GroupAutoCompleteFormatter implements FormatterInterface
class GroupAutoCompleteFormatter extends BaseFormatter implements FormatterInterface
{
/**
* Groups found
*
* @access private
* @access protected
* @var GroupProviderInterface[]
*/
private $groups;
protected $groups;
/**
* Format groups for the ajax auto-completion
* Set groups
*
* @access public
* @param GroupProviderInterface[] $groups
* @return $this
*/
public function __construct(array $groups)
public function withGroups(array $groups)
{
$this->groups = $groups;
}
/**
* Set query
*
* @access public
* @param Table $query
* @return FormatterInterface
*/
public function withQuery(Table $query)
{
return $this;
}