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

ODM #110

Open
Keko94 opened this issue Jun 9, 2017 · 12 comments
Open

ODM #110

Keko94 opened this issue Jun 9, 2017 · 12 comments
Assignees
Labels
Milestone

Comments

@Keko94
Copy link

Keko94 commented Jun 9, 2017

How can I use this bundle with MongoDB ?

@hackzilla
Copy link
Collaborator

It should be possible, as I did write the bundle with the expectation to use other data sources.
Use the model interfaces, and then register your entities in the app config.

Doctrine Ticket Entity Example

Then to register your class:
https://github.com/hackzilla/TicketBundleDemoApp/blob/master/app/config/config.yml#L80

If you have any problems, then let mw know, and I'll have a better look.

Let me know if it works, as I haven't had anyone use a different data source (that I know of).

@Keko94
Copy link
Author

Keko94 commented Jun 10, 2017

I can't success, I think the problem is from the entity manager. The bundle works only with an ORM.
https://github.com/hackzilla/TicketBundle/blob/develop/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php

The service "hackzilla_ticket.ticket_manager" has a dependency on a non-existent service "doctrine.orm.entity_manager", one of my errors that I got.

Then do you think it's always possible to not use doctrine/orm, but an odb
I'm using FOSUserBundle with mongodb, my users work.

Thanks

@hackzilla
Copy link
Collaborator

Thank you for bringing this to my attention.
I had hoped that it was compatible, but I had forgotten about dependency.

This makes more sense if I deal with #109

At least now I have an example setup to work with (FOSUserBundle and mongodb)

Related to #47

@hackzilla hackzilla added the bug label Jun 11, 2017
@hackzilla hackzilla self-assigned this Jun 11, 2017
@hackzilla
Copy link
Collaborator

Can I ask what version of Symfony and PHP you are using?

@Keko94
Copy link
Author

Keko94 commented Jun 11, 2017 via email

@Keko94
Copy link
Author

Keko94 commented Jun 27, 2017

Any news ?
Maybe there is something interesting here: http://symfony.com/doc/current/doctrine/mapping_model_classes.html

@Keko94 Keko94 changed the title ODB ODM Jun 27, 2017
@hackzilla
Copy link
Collaborator

I apologise for the lack of feedback. I am still working on #109, as I noticed there were a couple of dependancies that needed removing.

I am still working on it.

@Keko94
Copy link
Author

Keko94 commented Jun 27, 2017

I just successed to make it work with mongodb. But... I did it fastly then it doesn't work anymore with orm, but it's not hard to make it work with both ! If I have time i will do it and i'll submit a pull request ;)

@hackzilla
Copy link
Collaborator

If you link me to the mongodb version, then I'm sure I can combine them.
Personally, I don't have any experience with mongodb, so it will help.

@hackzilla
Copy link
Collaborator

I've just pushed an alpha version #109.

The plan is to create a ODM version of this.
https://github.com/hackzilla/TicketBundle/blob/develop/Manager/StorageManager/DoctrineOrmStorageManager.php

@hackzilla
Copy link
Collaborator

I think I've got it mostly working.

You'll have to use the develop branch for the moment, as its still not quite finished.

        "hackzilla/ticket-bundle": "dev-develop",

If you need an example of how got it setup then checkout https://github.com/hackzilla/TicketBundleDemoApp/tree/feature/mongodb

At the moment, I can't get past this error in Mongo.

app/console  fos:user:crea admin

 [Doctrine\Common\Persistence\Mapping\MappingException]                                                   
  The class 'AppBundle\Entity\User' was not found in the chain configured namespaces FOS\UserBundle\Model  

@phansys
Copy link
Member

phansys commented Dec 11, 2018

@Keko94, are you still interested in this feature? If yes, I'd like to know if could you bring some testing for this. I'm working on #129, where I think the support for Doctrine ODM could be added.

Thank you.

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

3 participants