Le 13/05/2014 13:55, René Pöpperl a écrit :
Hi,

I'm using Netbeans 8.0 with ZF 2 and Doctrine 2.x as a ZF2 module. I've enabled Doctrine 2 support in Netbeans and in project specific settings.

Netbeans knows doctrine annotations in the style of @Entity, @Id and so on. Doctrine needs annotations in the style of @ORM\Entity in the case of "'using"Doctrine\ORM\Mappings as ORM.

Here's the problem: Either Netbeans' code completion should be forced to understand the @ORM prefix, or Doctrine should be recognizing non-prefixed annotations. I don't know how to implement one of these solutions...

Can anybody help me with this?

Thx.


The prefix is optional in Doctrine. But if you sue @Entity and @Id, you will need to add lots of use statements in the class instead of adding a single use statement for their parent namespace. The resolution of annotations works the same than for resolving class names in your code:

use Doctrine\ORM\Mappings as ORM;
$annot = new ORM\Entity();

use Doctrine\ORM\Mappings\ORM\Entity;
$annot = new Entity();

But the Netbeans integration should indeed support the case of annotations being used through their namespace, as it is much more common in practice (to avoid having tons of use statements). You should report it to the Netbeans team though. This is not somehing the Doctrine team can fix.

Just for your information, PhpStorm supports annotations properly through the PHP-Annotations plugin http://plugins.jetbrains.com/plugin/7320 and Eclipse also supports them when using the Symfony2 plugin http://symfony.dubture.com/features/ (not sure it can be used for a ZF2 project as I'm not using Eclipse)

--
Christophe | Stof

--
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to