Exemplo n.º 1
0
 /**
  * @param ResourceInterface $resource
  *
  * @return Definition
  */
 private function createFactoryDefinition(ResourceInterface $resource)
 {
     $definition = new Definition($resource->getFactory(), [new Reference('lug.resource.' . $resource->getName()), new Reference('property_accessor')]);
     $definition->addTag('lug.factory', ['resource' => $resource->getName()]);
     return $definition;
 }
Exemplo n.º 2
0
 /**
  * @param ResourceInterface $resource
  *
  * @return Definition
  */
 private function createFactoryDefinition(ResourceInterface $resource)
 {
     $arguments = [new Reference('lug.resource.' . $resource->getName())];
     if (is_a($resource->getFactory(), TranslatableFactory::class, true)) {
         $arguments[] = new Reference('lug.translation.context.locale');
     }
     $definition = new Definition($resource->getFactory(), $arguments);
     $definition->addTag('lug.factory', ['resource' => $resource->getName()]);
     return $definition;
 }