Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with annotations namespaces when trying to guess form field type #69

Closed
clabra opened this issue May 8, 2012 · 1 comment
Closed

Comments

@clabra
Copy link

clabra commented May 8, 2012

If field type isn't set in Form/MyEntityType.php:

public function buildForm(FormBuilder $builder, array $options) 
  { 
      $builder 
          ->add('text')

Next exception is thrown when trying to guess type:
[Semantical Error] The annotation "@table" in class Entity\MyEntity was never imported. Did you maybe forget to add a "use" statement for this annotation?

If you put:
->add('text', 'textarea')
exception is not thrown

@stof
Copy link
Member

stof commented May 8, 2012

Fix your annotations. You need to import the annotation class through a use statement (or the parent namespace and changing it to @ORM\Table() if you prefer avoiding having lots of the use statements)
It is not directly related to the form. It is simply that the guesser is a place triggering the annotation reader.

@stof stof closed this as completed Sep 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants