Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function myManager(){
- $isDevMode = true;
- $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/AppBundle/Entity"), $isDevMode);
- // database configuration parameters
- $conn = array(
- 'dbname' => 'teste',
- 'user' => 'root',
- 'password' => '',
- 'host' => '127.0.0.1',
- 'driver' => 'pdo_mysql',
- );
- $entityManager = EntityManager::create($conn, $config);
- return $entityManager;
- }
- public function testAction(){
- $em = $this->myManager()->getRepository('Product');
- return $this->render('toto.html.twig');
- }
Add Comment
Please, Sign In to add comment