doctrine2 - Symfony 2.1 error: import @ORM\Table in repository -


i upgrading application symfony 2.0 symfony 2.1, followed this upgrade file , works fine except after cache:clear error when using repositories. here error:

[semantical error] annotation "@orm\table" in class  edasiclinic\alertesbundle\repository\alertesrepository never imported. did maybe forget add "use" statement annotation? 

this 1 example, error other repositories. don't understand why have import @orm\table inside repository file if don't use annotation there.

also if wait ~10 seconds , refresh browser, works...

edit

this entity:

<?php  namespace edasiclinic\databasebundle\entity;  use doctrine\orm\mapping orm;   /**  * edasiclinic\databasebundle\entity\alertes  *  * @orm\table(name="alertes")  * @orm\entity(repositoryclass="edasiclinic\alertesbundle\repository\alertesrepository")  * @orm\haslifecyclecallbacks()  */ class alertes {     /**      * @var integer $id      *      * @orm\id      * @orm\column(name="idalerta", type="integer")      * @orm\generatedvalue(strategy="identity")      */     private $id;      ... } 

and repository class:

<?php  namespace edasiclinic\alertesbundle\repository;  use doctrine\orm\entityrepository; use edasiclinic\dasibundle\funcions\aes;   class alertesrepository extends entityrepository {      public function countunread($user, $idioma, $fus)     {         // ...     } } 

thanks

i had same problem today. solution, after googling, apparently include comment block before repository class definition.

in case:

/**  * alertesrepository   */ class alertesrepository extends entityrepository {   ... }

without comment block, receive nonsensical error "@orm\table". yet symfony/doctrine oddity >_>


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -