-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix entity manager acquisition in the example app
- Loading branch information
Showing
3 changed files
with
6 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
$cli = include __DIR__.'/console.php'; | ||
$cli->run(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,12 +16,6 @@ | |
use Gedmo\DoctrineExtensions; | ||
use Symfony\Component\Console\Application; | ||
|
||
/* | ||
* This file is part of the Doctrine Behavioral Extensions package. | ||
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
/** @var EntityManager $em */ | ||
$em = include __DIR__.'/../em.php'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,6 @@ | |
use Gedmo\Tree\TreeListener; | ||
use Symfony\Component\Cache\Adapter\ArrayAdapter; | ||
|
||
/* | ||
* This file is part of the Doctrine Behavioral Extensions package. | ||
* (c) Gediminas Morkevicius <[email protected]> http://www.gediminasm.org | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
// this entity manager configuration works with the Doctrine DBAL and ORM. | ||
// Regarding the AnnotationDriver setup, it most probably will be changed into | ||
// XML because the annotation driver fails to read other classes in same namespace. | ||
|
@@ -176,6 +169,8 @@ | |
$config->setQueryCache($cache); | ||
$config->setResultCache($cache); | ||
|
||
// Finally, we create the entity manager | ||
$connection = DriverManager::getConnection($connection, $config); | ||
$em = new EntityManager($connection, $config, $eventManager); | ||
|
||
// Finally, we create and return the entity manager | ||
|
||
return new EntityManager($connection, $config, $eventManager); |