-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
44 lines (37 loc) · 1.33 KB
/
Module.php
File metadata and controls
44 lines (37 loc) · 1.33 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
<?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 Banner;
use Krystal\Http\FileTransfer\DirectoryBag;
use Krystal\Http\FileTransfer\UrlPathGenerator;
use Cms\AbstractCmsModule;
use Banner\Service\CategoryManager;
use Banner\Service\BannerManager;
use Banner\Service\SiteService;
final class Module extends AbstractCmsModule
{
/**
* {@inheritDoc}
*/
public function getServiceProviders()
{
$dirBag = new DirectoryBag($this->appConfig->getModuleUploadsDir('banner'));
$pathGenerator = new UrlPathGenerator('/data/uploads/module/banner');
// Mappers
$bannerMapper = $this->getMapper('/Banner/Storage/MySQL/BannerMapper');
$categoryMapper = $this->getMapper('/Banner/Storage/MySQL/CategoryMapper');
$bannerManager = new BannerManager($bannerMapper, $dirBag, $pathGenerator);
$categoryManager = new CategoryManager($categoryMapper);
return array(
'bannerManager' => $bannerManager,
'categoryManager' => $categoryManager,
'siteService' => new SiteService($bannerManager, $categoryMapper)
);
}
}