summaryrefslogtreecommitdiff
path: root/app/Formatter/BaseFormatter.php
blob: 89c484370e89b9d7e358d8cd4fa50d4a6003250a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

namespace Kanboard\Formatter;

use Kanboard\Core\Base;
use PicoDb\Table;
use Pimple\Container;

/**
 * Class BaseFormatter
 *
 * @package formatter
 * @author  Frederic Guillot
 */
abstract class BaseFormatter extends Base
{
    /**
     * Query object
     *
     * @access protected
     * @var Table
     */
    protected $query;

    /**
     * Get object instance
     *
     * @static
     * @access public
     * @param  Container $container
     * @return static
     */
    public static function getInstance(Container $container)
    {
        return new static($container);
    }

    /**
     * Set query
     *
     * @access public
     * @param  Table $query
     * @return $this
     */
    public function withQuery(Table $query)
    {
        $this->query = $query;
        return $this;
    }
}