Add LazyLocator

This commit is contained in:
Benoît Burnichon
2015-06-02 14:42:00 +02:00
parent fe057a8a6b
commit 7be5e332db
26 changed files with 117 additions and 126 deletions

View File

@@ -12,6 +12,7 @@
namespace Alchemy\Phrasea\ControllerProvider\Admin;
use Alchemy\Phrasea\Controller\Admin\UserController;
use Alchemy\Phrasea\Controller\LazyLocator;
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
use Silex\Application;
use Silex\ControllerProviderInterface;
@@ -25,12 +26,8 @@ class Users implements ControllerProviderInterface, ServiceProviderInterface
{
$app['controller.admin.users'] = $app->share(function () use ($app) {
return (new UserController($app))
->setDelivererLocator(function () use ($app) {
return $app['notification.deliverer'];
})
->setUserQueryFactory(function () use ($app) {
return $app['phraseanet.user-query'];
})
->setDelivererLocator(new LazyLocator($app, 'notification.deliverer'))
->setUserQueryFactory(new LazyLocator($app, 'phraseanet.user-query'))
;
});
}