aboutsummaryrefslogtreecommitdiff
path: root/src/bdrem/UserInterface.php
blob: cd1b7ccdd1f28c6219f18315a53df9400722e6fa (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
<?php
namespace bdrem;

abstract class UserInterface
{
    protected $config;

    public function run()
    {
        $this->config = new Config();
        $this->config->load();
        $this->config->date = date('Y-m-d');
        setlocale(LC_TIME, $this->config->locale);
        $source = $this->config->loadSource();

        $this->loadParameters($this->config);
        $arEvents = $source->getEvents(
            $this->config->date,
            $this->config->daysBefore, $this->config->daysAfter
        );
        usort($arEvents, '\\bdrem\\Event::compare');
        $this->render($arEvents);
    }

    protected function loadParameters()
    {
    }

    abstract protected function render($arEvents);
}
?>