|
@@ 253-260 (lines=8) @@
|
| 250 |
|
* |
| 251 |
|
* @return Definition |
| 252 |
|
*/ |
| 253 |
|
private function createRepositoryDefinition(ResourceInterface $resource) |
| 254 |
|
{ |
| 255 |
|
$definition = new Definition($resource->getRepository(), [$resource->getModel()]); |
| 256 |
|
$definition->setFactory([new Reference('lug.manager.'.$resource->getName()), 'getRepository']); |
| 257 |
|
$definition->addTag('lug.repository', ['resource' => $resource->getName()]); |
| 258 |
|
|
| 259 |
|
return $definition; |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
/** |
| 263 |
|
* @param ResourceInterface $resource |
|
@@ 319-329 (lines=11) @@
|
| 316 |
|
* |
| 317 |
|
* @return Definition |
| 318 |
|
*/ |
| 319 |
|
private function createControllerDefinition(ResourceInterface $resource) |
| 320 |
|
{ |
| 321 |
|
$definition = new Definition($resource->getController(), [ |
| 322 |
|
new Reference('lug.resource.'.$resource->getName()), |
| 323 |
|
]); |
| 324 |
|
|
| 325 |
|
$definition->addMethodCall('setContainer', [new Reference('service_container')]); |
| 326 |
|
$definition->addTag('lug.controller', ['resource' => $resource->getName()]); |
| 327 |
|
|
| 328 |
|
return $definition; |
| 329 |
|
} |
| 330 |
|
} |
| 331 |
|
|