コード例 #1
0
ファイル: JobFactory.php プロジェクト: rezzza/jobflow
 /**
  * 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);
 }
コード例 #2
0
ファイル: JobRegistry.php プロジェクト: rezzza/jobflow
 /**
  * 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);
 }