동일한 오류가 자주 여기에 게시되어 이전의 질문과 답변을 기반으로 읽었으며 변경 한 사항은 아무 소용이 없습니다.ZF2 - Doctrine2 MongoDB ODM - "클래스가 체인 구성 네임 스페이스에서 발견되지 않았습니다."
나는 작곡가를 통해 젠드 프레임 워크와 교리의 몽고 ODM를 설치하고 여기
https://github.com/doctrine/DoctrineMongoODMModule
설명 내 /config/autoload/module.doctrine-mongo-odm.local을 수정 한대로 설치를 완료했습니다. 여기에 비슷한 질문에 대한 답변을 기반으로 PHP는 내 문제를 해결하기 위해 위의 문서의 권고를 넘어 파일은
<?php
return array(
'doctrine' => array(
'connection' => array(
'odm_default' => array(
'server' => 'removed.mongolab.com',
'port' => '43957',
'user' => 'removed',
'password' => 'removed',
'dbname' => 'richard',
'options' => array()
),
),
'configuration' => array(
'odm_default' => array(
'metadata_cache' => 'array',
'driver' => 'odm_default',
'generate_proxies' => true,
'proxy_dir' => 'data/DoctrineMongoODMModule/Proxy',
'proxy_namespace' => 'DoctrineMongoODMModule\Proxy',
'generate_hydrators' => true,
'hydrator_dir' => 'data/DoctrineMongoODMModule/Hydrator',
'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator',
'default_db' => 'richard',
'filters' => array(),
'logger' => null
)
),
'odm_default' => array(
'drivers' => array(
'Application\Document' => 'odm_driver'
)
),
'odm_driver' => array(
'class' => 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(
'module/Application/src/Application/Document'
),
),
'documentmanager' => array(
'odm_default' => array(
'connection' => 'odm_default',
'configuration' => 'odm_default',
'eventmanager' => 'odm_default'
)
),
'eventmanager' => array(
'odm_default' => array(
'subscribers' => array()
)
),
),
);
내가 파일/모듈/응용 프로그램,이 다음 지금 보이도록로 n/src/Application/Document/User.php 다음과 같이
<?php
namespace Application\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations;
class User {
/** @ODM\Id */
private $id;
/** @ODM\Field(type="bin_data_timestamp") */
private $timestamp;
/** @ODM\Field(type="string") */
private $username;
/** @ODM\Field(type="bin_data_md5") */
private $password;
/** @ODM\Field(type="bin_data_uuid") */
private $salt;
/** @ODM\Field(type="string") */
private $realName;
/** @ODM\Field(type="string") */
private $email;
public function getId() {
return $this->id;
}
// ...
public function setId($id) {
$this->id = $id;
}
// ...
}
내 컨트롤러에 다음 코드를 사용하고 있습니다.
$dm = $this->getServiceLocator()->get('doctrine.documentmanager.odm_default');
$user = new User;
$user->setUsername("test");
$dm->persist($user);
$dm->flush();
그러나, 나는 어떤 도움을 크게 감상 할 수
The class 'Application\Document\User' was not found in the chain configured namespaces
악명 높은 오류를 받고 있어요.
중복 가능성 [젠드 프레임 워크 2 + 교리 ODM, 오류가 "클래스가 체인 구성 스페이스에서 찾을 수 없습니다"? (http://stackoverflow.com/questions/12540224/zend-framework-2 -doctrine-odm-the-class-was-the-chain-configure에서 발견 된) – Maks3w