Entity Manager

The EntityManager is the central access point for the ORM functionality. Bootstrapping it is easy:

use DoctrineDBALTypesType;
use DoctrineORMEntityManager;
use DoctrineORMTools;

Type::addType(
'post_id',
'InfrastructurePersistenceDoctrineTypesPostIdType'
);

Type::addType(
'body',
'InfrastructurePersistenceDoctrineTypesBodyType'
);

$entityManager = EntityManager::create(
[
'driver' => 'pdo_sqlite',
'path'=> __DIR__ . '/db.sqlite',
],
ToolsSetup::createXMLMetadataConfiguration(
['/Path/To/Infrastructure/Persistence/Doctrine/Mapping'],
$devMode = true
)
);

Remember to configure it according to your needs and setup.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset