Exemplo n.º 1
0
 /**
  * Creates wrapper for combination of JobType and JobConnector
  *
  * @param JobTypeInterface $type
  *
  * @return ResolvedJob
  */
 public function resolveType(JobTypeInterface $type)
 {
     $parentType = $type->getParent();
     if ($parentType instanceof JobTypeInterface) {
         $parentType = $this->resolveType($parentType);
     } elseif (null !== $parentType) {
         $parentType = $this->registry->getType($parentType);
     }
     return $this->createResolvedType($type, $parentType);
 }
Exemplo n.º 2
0
 /**
  * Wraps a type into a ResolvedFormTypeInterface implementation and connects
  * it with its parent type.
  *
  * @param JobTypeInterface $type The type to resolve.
  *
  * @return ResolvedJob The resolved type.
  */
 private function resolveAndAddType(JobTypeInterface $type)
 {
     $parentType = $type->getParent();
     if ($parentType instanceof JobTypeInterface) {
         $this->resolveAndAddType($parentType);
         $parentType = $parentType->getName();
     }
     $typeExtensions = array();
     foreach ($this->extensions as $extension) {
         /* @var FormExtensionInterface $extension */
         $typeExtensions = array_merge($typeExtensions, $extension->getTypeExtensions($type->getName()));
     }
     $this->types[$type->getName()] = new ResolvedJob($type, $typeExtensions, $parentType ? $this->getType($parentType) : null);
 }