-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Autocompletion on Document Repositories (Doctrine ODM) #205
Comments
yes its just not in, also reported in #201 :) i also need the registered document namespaces. it would be helpful to get a stripped container file with mongo config, so i dont need to build a complete test system |
Documents are registered in src/BundleNamespace/Document , but what do you need in appDevDebugProjectContainer.xml ? Mine is very huge, with ton of services declaration & parameters ;) |
src/*/Document need to be registered somewhere. on orm its "setEntityNamespaces", odm should have some similar stuff. <service class="Doctrine\ORM\Configuration" public="false">
<call method="setEntityNamespaces">
<argument type="collection">
<argument key="YourTestBundle">Your\TestBundle\Entity</argument>
</argument>
</call>
</service> |
setDocumentNamespaces ;) https://gist.github.com/fmeynard/8094367 i want you more info :) |
thx, thats all i need to implement this feature :) |
Very thx :) Update this ticket if you want a test :) |
just to collect all stuff here: $mongo = $this->get('doctrine_mongodb'); // $mongo == \Doctrine\Bundle\MongoDBBundle\ManagerRegistry
$repo = $mongo->getRepository('MyBundle:Person'); // $repo == \Doctrine\Common\Persistence\ObjectRepository
$manager = $mongo->getManager(); // $manager == \Doctrine\Common\Persistence\ObjectManager
$repo = $manager->getRepository('MyBundle:Person'); // $repo == \Doctrine\Common\Persistence\ObjectRepository |
Do you need something? :) ( i can't compile a jar atm ) |
iam working on it :) |
need some more improvements, but it should work now. |
@Haehnchen how it possible to make more generic sollution? To take easy support of the other http://www.doctrine-project.org/projects.html projects |
i just did preparation on refactoring for that. if projects follow same naming convention, all i need to do is to extend the following lines: "/container/services/service[@id[starts-with(.,'doctrine.orm.')]]//call[@method='setEntityNamespaces']//argument[@key]";
"/container/services/service[@id[starts-with(.,'doctrine_mongodb.odm.')]]//call[@method='setDocumentNamespaces']//argument[@key]"; // some default bundle search path
// Bundle/Resources/config/doctrine/Product.orm.yml
// Bundle/Resources/config/doctrine/Product.mongodb.yml
List<String[]> managerConfigs = new ArrayList<String[]>();
managerConfigs.add(new String[] { "Entity", "orm"});
managerConfigs.add(new String[] { "Document", "mongodb"}); |
Superb! |
if someone really need other doctrine project support, pls open another issue with necessary configs |
Thx u :) |
I can't see autocompletion on Doctrine documents names in $dm->getRepository(), is it a configuration problem or is the feature not implemented yet?
My project uses annotations.
For what I see in the EntityHelper, your matching classnames starting with 'Entity', and not 'Document'.
The text was updated successfully, but these errors were encountered: