Use SubDefinitionSubstituerAware in some Controllers

This commit is contained in:
Benoît Burnichon
2015-06-02 13:59:33 +02:00
parent 4eea27d9be
commit 6df9626fce
6 changed files with 19 additions and 26 deletions

View File

@@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller\Prod;
use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware;
use Alchemy\Phrasea\Application\Helper\DispatcherAware;
use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Core\Event\RecordEdit;
@@ -23,6 +24,7 @@ class EditController extends Controller
{
use DataboxLoggerAware;
use DispatcherAware;
use SubDefinitionSubstituerAware;
public function submitAction(Request $request)
{
@@ -373,12 +375,4 @@ class EditController extends Controller
return $this->app->json(['success' => true]);
}
/**
* @return SubdefSubstituer
*/
private function getSubDefinitionSubstituer()
{
return $this->app['subdef.substituer'];
}
}

View File

@@ -14,6 +14,7 @@ use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware;
use Alchemy\Phrasea\Application\Helper\DelivererAware;
use Alchemy\Phrasea\Application\Helper\EntityManagerAware;
use Alchemy\Phrasea\Application\Helper\FilesystemAware;
use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware;
use Alchemy\Phrasea\Border;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
use Alchemy\Phrasea\Controller\Controller;
@@ -32,6 +33,7 @@ class LazaretController extends Controller
use DelivererAware;
use EntityManagerAware;
use FilesystemAware;
use SubDefinitionSubstituerAware;
/**
* List all elements in lazaret
@@ -460,12 +462,4 @@ class LazaretController extends Controller
{
return $this->app['border-manager'];
}
/**
* @return SubdefSubstituer
*/
private function getSubDefinitionSubstituer()
{
return $this->app['subdef.substituer'];
}
}

View File

@@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller\Prod;
use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware;
use Alchemy\Phrasea\Application\Helper\FilesystemAware;
use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Exception\RuntimeException;
@@ -28,6 +29,7 @@ class ToolsController extends Controller
{
use DataboxLoggerAware;
use FilesystemAware;
use SubDefinitionSubstituerAware;
public function indexAction(Request $request)
{
@@ -297,14 +299,6 @@ class ToolsController extends Controller
return $this->app['mediavorus'];
}
/**
* @return SubdefSubstituer
*/
private function getSubDefinitionSubstituer()
{
return $this->app['subdef.substituer'];
}
/**
* @return PhraseanetMetadataSetter
*/

View File

@@ -27,7 +27,11 @@ class Edit implements ControllerProviderInterface, ServiceProviderInterface
$app['controller.prod.edit'] = $app->share(function (PhraseaApplication $app) {
return (new EditController($app))
->setDataboxLoggerLocator($app['phraseanet.logger'])
->setDispatcher($app['dispatcher']);
->setDispatcher($app['dispatcher'])
->setSubDefinitionSubstituerLocator(function () use ($app) {
return $app['subdef.substituer'];
})
;
});
}

View File

@@ -35,7 +35,11 @@ class Lazaret implements ControllerProviderInterface, ServiceProviderInterface
})
->setFileSystemLocator(function () use ($app) {
return $app['filesystem'];
});
})
->setSubDefinitionSubstituerLocator(function () use ($app) {
return $app['subdef.substituer'];
})
;
});
}

View File

@@ -30,6 +30,9 @@ class Tools implements ControllerProviderInterface, ServiceProviderInterface
->setFileSystemLocator(function () use ($app) {
return $app['filesystem'];
})
->setSubDefinitionSubstituerLocator(function () use ($app) {
return $app['subdef.substituer'];
})
;
});
}