-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
51 lines (43 loc) · 1.74 KB
/
Module.php
File metadata and controls
51 lines (43 loc) · 1.74 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
48
49
50
51
<?php
/**
* This file is part of the Bono CMS
*
* Copyright (c) No Global State Lab
*
* For the full copyright and license information, please view
* the license file that was distributed with this source code.
*/
namespace Structure;
use Cms\AbstractCmsModule;
use Structure\Service\CollectionService;
use Structure\Service\FieldService;
use Structure\Service\SiteService;
use Structure\Service\RepeaterService;
use Structure\Service\FileInput;
final class Module extends AbstractCmsModule
{
/**
* {@inheritDoc}
*/
public function getServiceProviders()
{
$request = $this->getServiceLocator()->get('request');
$cache = $this->createCacheEngine('structure.cache');
// Build data mappers
$collectionMapper = $this->getMapper('\Structure\Storage\MySQL\CollectionMapper');
$fieldMapper = $this->getMapper('\Structure\Storage\MySQL\FieldMapper');
$repeaterMapper = $this->getMapper('\Structure\Storage\MySQL\RepeaterMapper');
$valueMapper = $this->getMapper('\Structure\Storage\MySQL\RepeaterValueMapper');
$languageManager = $this->getCmsModule()->getService('languageManager');
$fileInput = new FileInput($this->appConfig->getRootDir());
$repeaterService = new RepeaterService($repeaterMapper, $valueMapper, $fileInput);
$collectionService = new CollectionService($collectionMapper);
return [
'cache' => $cache,
'siteService' => new SiteService($cache, $repeaterService, $collectionService, $request, $languageManager->getCurrentId()),
'collectionService' => $collectionService,
'fieldService' => new FieldService($fieldMapper),
'repeaterService' => $repeaterService
];
}
}