@@ 45-61 (lines=17) @@ | ||
42 | */ |
|
43 | private $authorizationAttribute; |
|
44 | ||
45 | public function __construct( |
|
46 | ControllerHelperInterface $controllerHelper, |
|
47 | array $options |
|
48 | ) { |
|
49 | Assert::keyExists($options, 'entity-class'); |
|
50 | Assert::null($this->controllerHelper); |
|
51 | ||
52 | $options = array_merge([ |
|
53 | 'authorization-attribute' => null, |
|
54 | 'entity-id-key' => 'entityId', |
|
55 | ], $options); |
|
56 | ||
57 | $this->controllerHelper = $controllerHelper; |
|
58 | $this->entityClass = $options['entity-class']; |
|
59 | $this->entityIdKey = $options['entity-id-key']; |
|
60 | $this->authorizationAttribute = $options['authorization-attribute']; |
|
61 | } |
|
62 | ||
63 | public function __invoke(): Response |
|
64 | { |
@@ 49-67 (lines=19) @@ | ||
46 | */ |
|
47 | private $authorizationAttribute; |
|
48 | ||
49 | public function __construct( |
|
50 | ControllerHelperInterface $controllerHelper, |
|
51 | ArgumentCompilerInterface $argumentCompiler, |
|
52 | array $options |
|
53 | ) { |
|
54 | Assert::null($this->controllerHelper); |
|
55 | Assert::keyExists($options, 'template'); |
|
56 | ||
57 | $options = array_merge([ |
|
58 | 'arguments' => [], |
|
59 | 'authorization-attribute' => null, |
|
60 | ], $options); |
|
61 | ||
62 | $this->controllerHelper = $controllerHelper; |
|
63 | $this->argumentCompiler = $argumentCompiler; |
|
64 | $this->templatePath = $options['template']; |
|
65 | $this->arguments = $options['arguments']; |
|
66 | $this->authorizationAttribute = $options['authorization-attribute']; |
|
67 | } |
|
68 | ||
69 | public function __invoke(): Response |
|
70 | { |