コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getOptionsResolver()
 {
     if (null === $this->optionsResolver) {
         if (null !== $this->parent) {
             $this->optionsResolver = clone $this->parent->getOptionsResolver();
         } else {
             $this->optionsResolver = new OptionsResolver();
         }
         $this->innerType->configureOptions($this->optionsResolver);
         foreach ($this->typeExtensions as $extension) {
             $extension->configureOptions($this->optionsResolver);
         }
     }
     return $this->optionsResolver;
 }
コード例 #2
0
ファイル: FieldRegistry.php プロジェクト: rollerworks/search
 /**
  * Wraps a type into a ResolvedFieldTypeInterface implementation and connects
  * it with its parent type.
  *
  * @param FieldTypeInterface $type The type to resolve
  *
  * @return ResolvedFieldTypeInterface The resolved type
  */
 private function resolveAndAddType(FieldTypeInterface $type)
 {
     $parentType = $type->getParent();
     if ($parentType instanceof FieldTypeInterface) {
         $this->resolveAndAddType($parentType);
         $parentType = $parentType->getName();
     }
     $typeExtensions = [];
     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);
 }
コード例 #3
0
ファイル: SearchFactory.php プロジェクト: rollerworks/search
 /**
  * Wraps a type into a ResolvedFieldTypeInterface implementation and connects
  * it with its parent type.
  *
  * @param FieldTypeInterface $type The type to resolve
  *
  * @return ResolvedFieldTypeInterface The resolved type
  */
 private function resolveType(FieldTypeInterface $type)
 {
     $parentType = $type->getParent();
     if ($parentType instanceof FieldTypeInterface) {
         $parentType = $this->resolveType($parentType);
     } elseif (null !== $parentType) {
         $parentType = $this->registry->getType($parentType);
     }
     return $this->resolvedTypeFactory->createResolvedType($type, [], $parentType);
 }