2012-04-03 2 views

답변

0

다음 파일 구조를 만듭니다

application/ 
    /models/ 
     /Entities/ 
      User.php 

및 User.php 모델은 다음 네임 스페이스가 있습니다

namespace Entities; 

class User { ... } 

$user = new \Entities\User(); 

내가 정확히 파일 구조를 가지고

$driverImpl = $config->newDefaultAnnotationDriver('/path/to/app/application/models/Entities'); 
$config->setMetadataDriverImpl($driverImpl); 
+0

을 설정하는 것을 잊지 해달라고을 당신 제안, 필자 엔티티 파일이 yalm 파일을 사용하여 작성되었다는 언급을하지 못했습니다. 클래스 엔티티를 작성한 경우 m 나는 네임 스페이스에 누락 된 줄을 추가 할 수 있다고 생각한다. 나는 아직도이 교리의 문제로 길을 잃었다. – MikeGA

관련 문제