Permalink
Browse files

self

  • Loading branch information...
1 parent 04c8be7 commit 3c26e37172e34125365c76a8ea0e5834e75ea9ee mparaiso committed Mar 25, 2013
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/Mparaiso/Provider/DoctrineORMServiceProvider.php
@@ -29,7 +29,7 @@ public function boot(Application $app)
}
- static function getDriver($type, array $paths, Configuration $config)
+ function getDriver($type, array $paths, Configuration $config)
{
$driver = NULL;
switch ($type) {
@@ -47,6 +47,7 @@ static function getDriver($type, array $paths, Configuration $config)
public function register(Application $app)
{
+ $self = $this;
$app["orm.proxy_dir"] = NULL;
$app["orm.cache"] = NULL;
$app["orm.is_dev_mode"] = $app["debug"];
@@ -71,12 +72,12 @@ public function register(Application $app)
* EN : create the entity manager
* FR : créer l'entity manager
*/
- $app["orm.em"] = $app->share(function ($app) {
+ $app["orm.em"] = $app->share(function ($app)use($self) {
foreach ($app["orm.driver.configs"] as $key => $config) {
if ($key == "default") {
- $app["orm.chain_driver"]->setDefaultDriver(DoctrineORMServiceProvider::getDriver($config['type'], $config['paths'], $app["orm.config"]));
+ $app["orm.chain_driver"]->setDefaultDriver($self::getDriver($config['type'], $config['paths'], $app["orm.config"]));
}
- $app["orm.chain_driver"]->addDriver(DoctrineORMServiceProvider::getDriver($config['type'], $config['paths'], $app["orm.config"]), $config["namespace"]);
+ $app["orm.chain_driver"]->addDriver($self::getDriver($config['type'], $config['paths'], $app["orm.config"]), $config["namespace"]);
}
if (!isset($app["orm.connection"]) && $app["db"]) {
$app["orm.connection"] = $app["db"];

0 comments on commit 3c26e37

Please sign in to comment.