doughnut-wedding/doctrine.php

31 lines
800 B
PHP
Raw Normal View History

2017-02-10 21:34:31 -08:00
<?php
use Jgut\Slim\Doctrine\ManagerBuilder;
require __DIR__ . '/vendor/autoload.php';
$settings = [
'default' => [
'annotation_autoloaders' => ['class_exists'],
'connection' => [
'driver' => 'pdo_mysql',
'user' => 'doughnut',
'password' => 'doughnut',
'dbname' => 'doughnut',
'host' => 'mysql',
],
'metadata_mapping' => [
[
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
'path' => [__DIR__ . '/src/Sikofitt/App/Entity'],
],
],
],
];
$managerBuilder = new ManagerBuilder([ManagerBuilder::RELATIONAL_MANAGER_KEY => 'default']);
$managerBuilder->loadSettings($settings);
return $managerBuilder->getManager('entityManager');