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

Autocompletion on Document Repositories (Doctrine ODM) #205

Closed
maphe opened this issue Dec 23, 2013 · 15 comments
Closed

Autocompletion on Document Repositories (Doctrine ODM) #205

maphe opened this issue Dec 23, 2013 · 15 comments
Labels

Comments

@maphe
Copy link

maphe commented Dec 23, 2013

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'.

@Haehnchen
Copy link
Owner

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

see:
https://github.com/Haehnchen/idea-php-symfony2-plugin/blob/master/tests/fr/adrienbrault/idea/symfony2plugin/tests/doctrine/component/appDevDebugProjectContainer.xml

@fmeynard
Copy link

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 ;)

@Haehnchen
Copy link
Owner

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>

@fmeynard
Copy link

setDocumentNamespaces ;)

https://gist.github.com/fmeynard/8094367 i want you more info :)

@Haehnchen
Copy link
Owner

thx, thats all i need to implement this feature :)

@fmeynard
Copy link

Very thx :) Update this ticket if you want a test :)

@Haehnchen
Copy link
Owner

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

@fmeynard
Copy link

Do you need something? :) ( i can't compile a jar atm )

@Haehnchen
Copy link
Owner

iam working on it :)

@Haehnchen
Copy link
Owner

need some more improvements, but it should work now.

@Koc
Copy link
Contributor

Koc commented Dec 28, 2013

@Haehnchen how it possible to make more generic sollution? To take easy support of the other http://www.doctrine-project.org/projects.html projects

@Haehnchen
Copy link
Owner

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"});

@Koc
Copy link
Contributor

Koc commented Dec 28, 2013

Superb!

@Haehnchen
Copy link
Owner

if someone really need other doctrine project support, pls open another issue with necessary configs

@fmeynard
Copy link

Thx u :)

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

No branches or pull requests

4 participants