forked from mtierltd/timetracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.php
More file actions
47 lines (34 loc) · 1.09 KB
/
Application.php
File metadata and controls
47 lines (34 loc) · 1.09 KB
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
<?php
namespace OCA\TimeTracker\AppInfo;
require_once __DIR__ . '/../../vendor/autoload.php';
use \OCP\AppFramework\App;
use \OCP\AppFramework\IAppContainer;
use \OCA\TimeTracker\Controller\AjaxController;
//use \OCA\TimeTracker\Service\AuthorService;
//use \OCA\TimeTracker\Db\AuthorMapper;
use OCA\TimeTracker\Db\WorkIntervalMapper;
use OCA\TimeTracker\Controller\PageController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use OCP\IL10N;
class Application extends App {
/**
* Define your dependencies in here
*/
public function __construct(array $urlParams=array()){
parent::__construct('timetracker', $urlParams);
$container = $this->getContainer();
/**
* Controllers
*/
$container->registerService('WorkIntervalMapper', function($c){
return new WorkIntervalMapper(
$c->query('ServerContainer')->getDatabaseConnection()
);
});
$container->registerService('ReportItemMapper', function($c){
return new WorkIntervalMapper(
$c->query('ServerContainer')->getDatabaseConnection()
);
});
}
}