|
@@ 268-275 (lines=8) @@
|
| 265 |
|
* |
| 266 |
|
* @return Definition |
| 267 |
|
*/ |
| 268 |
|
private function createRepositoryDefinition(ResourceInterface $resource) |
| 269 |
|
{ |
| 270 |
|
$definition = new Definition($resource->getRepository(), [$resource->getModel()]); |
| 271 |
|
$definition->setFactory([new Reference('lug.manager.'.$resource->getName()), 'getRepository']); |
| 272 |
|
$definition->addTag('lug.repository', ['resource' => $resource->getName()]); |
| 273 |
|
|
| 274 |
|
return $definition; |
| 275 |
|
} |
| 276 |
|
|
| 277 |
|
/** |
| 278 |
|
* @param ResourceInterface $resource |
|
@@ 334-344 (lines=11) @@
|
| 331 |
|
* |
| 332 |
|
* @return Definition |
| 333 |
|
*/ |
| 334 |
|
private function createControllerDefinition(ResourceInterface $resource) |
| 335 |
|
{ |
| 336 |
|
$definition = new Definition($resource->getController(), [ |
| 337 |
|
new Reference('lug.resource.'.$resource->getName()), |
| 338 |
|
]); |
| 339 |
|
|
| 340 |
|
$definition->addMethodCall('setContainer', [new Reference('service_container')]); |
| 341 |
|
$definition->addTag('lug.controller', ['resource' => $resource->getName()]); |
| 342 |
|
|
| 343 |
|
return $definition; |
| 344 |
|
} |
| 345 |
|
} |
| 346 |
|
|