/**
  * @param ResolvedFormTypeInterface|null $formType
  * @param array                          &$types
  */
 public static function typeAncestryForType(ResolvedFormTypeInterface $formType = null, array &$types)
 {
     if (!$formType instanceof ResolvedFormTypeInterface) {
         return;
     }
     $types[] = get_class($formType->getInnerType());
     self::typeAncestryForType($formType->getParent(), $types);
 }
Ejemplo n.º 2
0
 /**
  * Check if the parent type of the current type is allowed.
  *
  * @param string[]                  $types The class name of types
  * @param ResolvedFormTypeInterface $rType The resolved form type
  *
  * @return bool
  */
 protected static function isType(array $types, ResolvedFormTypeInterface $rType = null)
 {
     if (null === $rType) {
         return false;
     } elseif (!in_array(get_class($rType->getInnerType()), $types)) {
         return static::isType($types, $rType->getParent());
     }
     return true;
 }
 private function isFieldSingleUpload(ResolvedFormTypeInterface $formTypeInterface = null)
 {
     if ($formTypeInterface == null) {
         return false;
     }
     if ($formTypeInterface->getName() == 'afe_single_upload') {
         return true;
     }
     return $this->isFieldSingleUpload($formTypeInterface->getParent());
 }
 /**
  * {@inheritdoc}
  */
 public function getParent()
 {
     return $this->proxiedType->getParent();
 }