| @@ 120-144 (lines=25) @@ | ||
| 117 | ); |
|
| 118 | } |
|
| 119 | ||
| 120 | public function registerReadAction($mount, $name, $path, $repository, $class) |
|
| 121 | { |
|
| 122 | $definition = new Definition(ReadController::class); |
|
| 123 | $definition->setArguments( |
|
| 124 | [ |
|
| 125 | $repository, |
|
| 126 | $this->getEvm(), |
|
| 127 | ] |
|
| 128 | ); |
|
| 129 | ||
| 130 | $actionName = 'read'; |
|
| 131 | $controllerId = $this->generateControllerId($name, $actionName); |
|
| 132 | $this->container->setDefinition($controllerId, $definition); |
|
| 133 | ||
| 134 | $action = $controllerId . ':' . ReadController::ACTION; |
|
| 135 | $this->registerRoute( |
|
| 136 | $mount, |
|
| 137 | $name, |
|
| 138 | $actionName, |
|
| 139 | $path, |
|
| 140 | $action, |
|
| 141 | ['GET', 'POST'], |
|
| 142 | ['class' => $class, 'arguments' => ['identifier']] |
|
| 143 | ); |
|
| 144 | } |
|
| 145 | ||
| 146 | public function registerUpdateAction($mount, $name, $path, $repository, $processor, $manager, $class) |
|
| 147 | { |
|
| @@ 180-205 (lines=26) @@ | ||
| 177 | ); |
|
| 178 | } |
|
| 179 | ||
| 180 | public function registerDeleteAction($mount, $name, $path, $repository, $manager, $class) |
|
| 181 | { |
|
| 182 | $definition = new Definition(DeleteController::class); |
|
| 183 | $definition->setArguments( |
|
| 184 | [ |
|
| 185 | $repository, |
|
| 186 | $manager, |
|
| 187 | $this->getEvm(), |
|
| 188 | ] |
|
| 189 | ); |
|
| 190 | ||
| 191 | $actionName = 'delete'; |
|
| 192 | $controllerId = $controllerId = $this->generateControllerId($name, $actionName); |
|
| 193 | $this->container->setDefinition($controllerId, $definition); |
|
| 194 | ||
| 195 | $action = $controllerId . ':' . DeleteController::ACTION; |
|
| 196 | $this->registerRoute( |
|
| 197 | $mount, |
|
| 198 | $name, |
|
| 199 | $actionName, |
|
| 200 | $path, |
|
| 201 | $action, |
|
| 202 | ['POST', 'DELETE'], |
|
| 203 | ['class' => $class, 'arguments' => ['identifier']] |
|
| 204 | ); |
|
| 205 | } |
|
| 206 | ||
| 207 | public function registerSearchAction($mount, $name, $path, $class, $repository, $criteria) |
|
| 208 | { |
|