모델/폴더라고하면 내 엔티티를 씁니다. 같은Doctrine 2로 엔티티를 직접 이동/작성해야합니까?
뭔가 :
namespace Organisation\User;
/**
@Entity
*/
class Customer {
/**
* @Column(type="integer") @GeneratedValue
*/
protected $_id;
}
}
그래서 내가 $customer = new \Organisation\User\Customer();
좋아 내 개체의 인스턴스거야,하지만 난 doctrine orm:generate-entities library/
를 사용하는 경우는 다음과 같은 디렉토리를 생성합니다
library/Organisation/User/Customer.php
괜찮아요. 코드에서 주석이 하나도 없으므로 사용하려고하면 주석이 없기 때문에 doctrine\ORM\Mapping\MappingException: Class Organisation\User\Customer is not a valid entity or mapped super class.
이됩니다.
그래서 네임 스페이스를 제거하고 메타 데이터 정보가있는 엔티티와 동일한 디렉토리에 생성하고 내 라이브러리 폴더로 이동 한 다음 작업 할 네임 스페이스를 추가해야합니다.
보기 흉한 것처럼 보이지만 뭔가 놓쳤습니까? 당신이 쓴 경우 생성-기관이 반복적으로, 다음, 나는 심지어 내 엔티티 메타 데이터