* updated expressive version
This commit is contained in:
66
src/DoctrineExpressiveModule/ConfigProvider.php
Normal file
66
src/DoctrineExpressiveModule/ConfigProvider.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineExpressiveModule;
|
||||
|
||||
use Zend\EventManager\EventManager;
|
||||
|
||||
/**
|
||||
* The configuration provider for the DoctrineExpressiveModule module
|
||||
*
|
||||
* @see https://docs.zendframework.com/zend-component-installer/
|
||||
*/
|
||||
class ConfigProvider
|
||||
{
|
||||
/**
|
||||
* Returns the configuration array
|
||||
*
|
||||
* To add a bit of a structure, each section is defined in a separate
|
||||
* method which returns an array with its configuration.
|
||||
*
|
||||
*/
|
||||
public function __invoke() : array
|
||||
{
|
||||
return [
|
||||
'dependencies' => $this->getDependencies(),
|
||||
'form_elements' => $this->getFormElements(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the container dependencies
|
||||
*/
|
||||
public function getDependencies() : array
|
||||
{
|
||||
return [
|
||||
'aliases' => [
|
||||
'doctrine.hydrator' => Hydrator\DoctrineObject::class,
|
||||
'EventManager' => EventManager::class,
|
||||
\Doctrine\ORM\EntityManager::class => 'doctrine.entity_manager.orm_default',
|
||||
],
|
||||
'invokables' => [
|
||||
EventManager::class => EventManager::class,
|
||||
],
|
||||
'factories' => [
|
||||
Hydrator\DoctrineObject::class => Hydrator\DoctrineObjectFactory::class,
|
||||
'doctrine.entity_manager.orm_default' => \ContainerInteropDoctrine\EntityManagerFactory::class,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the form dependencies
|
||||
*/
|
||||
public function getFormElements() : array
|
||||
{
|
||||
return [
|
||||
'aliases' => [
|
||||
'doctrine.object_select' => Form\Element\ObjectSelect::class,
|
||||
],
|
||||
'factories' => [
|
||||
Form\Element\ObjectSelect::class => Form\Element\ElementFactory::class,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user