2017-12-20 16 views
1

을 자동로드 할 수 없습니다 클래스의 주석 @Doctrine \ ORM \ 매핑 \ 모델 :심포니 3 [의미 론적 오류] AppBundle 엔티티 사용자가 존재하지 않는, 또는 내가 로그인하려고 할 때

[Semantical Error] The annotation "@Doctrine\ORM\Mapping\Model" in class AppBundle\Entity\User does not exist, or could not be auto-loaded. 

내 엔티티 : 나는 번들로 내 코드를 refarcor을 시도하고 모든 일하는

namespace AppBundle\Entity; 

    use Doctrine\Common\Collections\ArrayCollection; 
    use Doctrine\ORM\Mapping as ORM; 
    use Symfony\Component\Security\Core\User\UserInterface; 
    use Symfony\Component\Validator\Constraints as Assert; 
    use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; 

    /** 
    * @ORM\Model() 
    * @ORM\Table() 
    */ 
    class User implements UserInterface 
    { 
    } 

. 이제이 오류가

enable_annotations 나타 사실이다

정말 사람이 알고 있나요 잘못해야하는지 이해하지?

use Doctrine\ORM\Mapping\Id; 
use Doctrine\ORM\Mapping\Column; 
use Doctrine\ORM\Mapping\Entity; 
use Symfony\Component\Security\Core\User\UserInterface; 

/** @Entity */ 
class User implements UserInterface 
{} 

당신의 실체는 다음과 같습니다

+1

왜 *) (* @ ORM의 \ 모델을 작성하는? 대신 개체 /** * @ORM \ 엔티티() * @ORM의 \ 테이블 (이름 = "사용자")/ – Generwp

+0

아 내가 알고 있지만 모든 를 * 일하는 그나마이 같은 것을 할 필요가 지금부터. 어쨌든 도움이되는 답변을 보내 주셔서 감사합니다 :-) –

+0

AFLICT Doctrine v2에 'Model'이라는 주석이 없습니다. –

답변

0

내 기업은 다음 구문이? 엔터티가 Entity 폴더에있는 경우 User을 제거하는 네임 스페이스를 변경해야합니다. 내 엔티티의 다른

은 다음과 같습니다

namespace AppBundle\Entity; 

use Doctrine\ORM\Mapping as ORM; 

/** 
* Usuario 
* 
* @ORM\Table(name="table.usuario", uniqueConstraints= {@ORM\UniqueConstraint(name="matricula_UNIQUE", columns={"matricula"})}) 
* @ORM\Entity 
*/ 
class Usuario 
{}