private function convertObjectDefinition(ContainerBuilder $container, ObjectDefinitionInterface $definition)
 {
     $symfonyDefinition = new Definition();
     $symfonyDefinition->setClass($definition->getClassName());
     $symfonyDefinition->setArguments($this->convertArguments($container, $definition->getConstructorArguments()));
     foreach ($definition->getPropertyAssignments() as $propertyAssignment) {
         $symfonyDefinition->setProperty($propertyAssignment->getPropertyName(), $this->convertArguments($container, $propertyAssignment->getValue()));
     }
     foreach ($definition->getMethodCalls() as $methodCall) {
         $symfonyDefinition->addMethodCall($methodCall->getMethodName(), $this->convertArguments($container, $methodCall->getArguments()));
     }
     return $symfonyDefinition;
 }
示例#2
0
 /**
  * @param object                    $service
  * @param ObjectDefinitionInterface $definition
  *
  * @return object
  */
 private function callAssignments($service, ObjectDefinitionInterface $definition)
 {
     foreach ($definition->getPropertyAssignments() as $propertyAssignment) {
         $propertyName = $propertyAssignment->getPropertyName();
         $service->{$propertyName} = $this->resolveSubDefinition($propertyAssignment->getValue());
     }
     return $service;
 }