/** * @param string $rootClass * @param Attribute $attribute * @return null|TypeGuess */ public function guessClassAttributeForm($rootClass, Attribute $attribute) { $propertyPath = $attribute->getPropertyPath(); if (!$propertyPath) { return $this->guessAttributeForm($attribute); } $attributeParameters = $this->guessMetadataAndField($rootClass, $propertyPath); if (!$attributeParameters) { return $this->guessAttributeForm($attribute); } /** @var ClassMetadata $metadata */ $metadata = $attributeParameters['metadata']; $class = $metadata->getName(); $field = $attributeParameters['field']; return $this->getFormTypeGuesser()->guessType($class, $field); }