Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document registration - Multiple namespaces #13

Open
svscorp opened this issue May 18, 2014 · 1 comment
Open

Document registration - Multiple namespaces #13

svscorp opened this issue May 18, 2014 · 1 comment

Comments

@svscorp
Copy link

svscorp commented May 18, 2014

There is a line in documentation:

Document registration
You need to register the differents documents namespace to make possible use it with Doctrine ODM, eg:

$app->register(new MongoDBODMServiceProvider(), array(
    // ...
    'doctrine.odm.mongodb.documents' => array(
        0 => array(
            'type' => 'annotation',
            'path' => array(
                'src/Acme/Entities',
            ),
            'namespace' => 'Acme/Entities',
            'alias'     => 'docs',
        ),
    ),
    // ...
));

you can add multiple folders/namespaces.

But actually if I do:

'namespace' => array('Acme\Entity', 'Acme\Entity\Folder')

I get an error:

PHP Warning:  Illegal offset type in ../vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php on line 82
PHP Warning:  trim() expects parameter 1 to be string, array given in ../vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Configuration.php on line 67
@DaMitchell
Copy link

I think it might mean you have to have a separate entry in 'doctrine.odm.mongodb.documents' for each folder/namespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants