-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
21 lines (15 loc) · 749 Bytes
/
bootstrap.php
File metadata and controls
21 lines (15 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
// bootstrap.php
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
require_once dirname(__FILE__) . "/lib/vendor/autoload.php";
include_once dirname(__FILE__) . "/lib/config/conn.php";
// Create a simple "default" Doctrine ORM configuration for Annotations
$isDevMode = true;
$entities = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . "/src/entities"), $isDevMode);
// or if you prefer yaml or XML
//$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
//$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);
// obtaining the entity manager
$entityManager = EntityManager::create(conn::$connection, $entities);
return $entityManager;