Exemplo n.º 1
0
 private function resolveType(TableTypeInterface $type)
 {
     $parentType = $type->getParent();
     if ($parentType instanceof TableTypeInterface) {
         $parentType = $this->resolveType($parentType);
     } elseif (null !== $parentType) {
         $parentType = $this->registry->getType($parentType);
     }
     return $this->resolvedTypeFactory->createResolvedType($type, array(), $parentType);
 }
Exemplo n.º 2
0
 /**
  * Wraps a type into a ResolvedTableTypeInterface implementation and connects
  * it with its parent type.
  *
  * @param TableTypeInterface $type The type to resolve.
  *
  * @return ResolvedTableTypeInterface The resolved type.
  */
 private function resolveAndAddType(TableTypeInterface $type)
 {
     $parentType = $type->getParent();
     if ($parentType instanceof TableTypeInterface) {
         $this->resolveAndAddType($parentType);
         $parentType = $parentType->getName();
     }
     $typeExtensions = array();
     foreach ($this->extensions as $extension) {
         $typeExtensions = array_merge($typeExtensions, $extension->getTypeExtensions($type->getName()));
     }
     $this->types[$type->getName()] = $this->resolvedTypeFactory->createResolvedType($type, $typeExtensions, $parentType ? $this->getType($parentType) : null);
 }
Exemplo n.º 3
0
 /**
  * Returns the configured options resolver used for this type.
  *
  * This method is protected in order to allow implementing classes
  * to change or call it in re-implementations of {@link createBuilder()}.
  *
  * @return \Symfony\Component\OptionsResolver\OptionsResolverInterface The options resolver.
  */
 public function getOptionsResolver()
 {
     if (null === $this->optionsResolver) {
         if (null !== $this->parent) {
             $this->optionsResolver = clone $this->parent->getOptionsResolver();
         } else {
             $this->optionsResolver = new OptionsResolver();
         }
         $this->innerType->setDefaultOptions($this->optionsResolver);
     }
     return $this->optionsResolver;
 }