1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author Stefano Torresi (http://stefanotorresi.it) |
4
|
|
|
* @license See the file LICENSE.txt for copying permission. |
5
|
|
|
* ************************************************ |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace Thorr\Persistence; |
9
|
|
|
|
10
|
|
|
use Zend\ModuleManager\Feature; |
11
|
|
|
use Zend\ModuleManager\Listener\ServiceListenerInterface; |
12
|
|
|
use Zend\ModuleManager\ModuleManagerInterface; |
13
|
|
|
use Zend\ServiceManager\ServiceManager; |
14
|
|
|
|
15
|
|
|
class Module implements |
16
|
|
|
Feature\ValidatorProviderInterface, |
17
|
|
|
Feature\InitProviderInterface, |
18
|
|
|
Feature\ServiceProviderInterface |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* {@inheritdoc} |
22
|
|
|
*/ |
23
|
4 |
|
public function init(ModuleManagerInterface $moduleManager) |
24
|
|
|
{ |
25
|
|
|
/** @var ServiceManager $serviceManager */ |
26
|
|
|
$serviceManager = $moduleManager->getEvent()->getParam('ServiceManager'); |
|
|
|
|
27
|
|
|
|
28
|
|
|
/** @var ServiceListenerInterface $serviceListener */ |
29
|
|
|
$serviceListener = $serviceManager->get('ServiceListener'); |
30
|
|
|
|
31
|
|
|
$serviceListener->addServiceManager( |
32
|
4 |
|
DataMapper\Manager\DataMapperManager::class, |
33
|
4 |
|
'thorr_persistence_dmm', |
34
|
4 |
|
DataMapper\Manager\DataMapperManagerConfigProviderInterface::class, |
35
|
4 |
|
'getDataMapperManagerConfig' |
36
|
|
|
); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* {@inheritdoc} |
41
|
|
|
*/ |
42
|
4 |
|
public function getServiceConfig() |
43
|
|
|
{ |
44
|
|
|
return [ |
45
|
|
|
'factories' => [ |
46
|
|
|
DataMapper\Manager\DataMapperManager::class => DataMapper\Manager\DataMapperManagerFactory::class, |
47
|
|
|
], |
48
|
|
|
'aliases' => [ |
49
|
|
|
'DataMapperManager' => DataMapper\Manager\DataMapperManager::class, |
50
|
|
|
], |
51
|
4 |
|
]; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* {@inheritdoc} |
56
|
|
|
*/ |
57
|
4 |
|
public function getValidatorConfig() |
58
|
|
|
{ |
59
|
|
|
return [ |
60
|
|
|
'factories' => [ |
61
|
|
|
Validator\EntityExistsValidator::class => new Factory\EntityValidatorFactory(Validator\EntityExistsValidator::class), |
62
|
|
|
Validator\EntityNotExistsValidator::class => new Factory\EntityValidatorFactory(Validator\EntityNotExistsValidator::class), |
63
|
4 |
|
], |
64
|
4 |
|
]; |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.