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

Using Data Transfer Objects (DTO) with APYDataGridBundle #957

Open
MaxandreOgeret opened this issue Jul 3, 2017 · 2 comments
Open

Using Data Transfer Objects (DTO) with APYDataGridBundle #957

MaxandreOgeret opened this issue Jul 3, 2017 · 2 comments

Comments

@MaxandreOgeret
Copy link

MaxandreOgeret commented Jul 3, 2017

Hello everyone. And sorry for the last post with no description.

Since Doctrine 2.4 a new operator has been created to work with DTOs : "NEW".
http://doctrine-orm.readthedocs.io/en/latest/reference/dql-doctrine-query-language.html#new-operator-syntax

It allows to hydrate an DTO object (wich is not an entity) directly from a DQL query. You can customize the DTO as you wish.
So doctrine will return an array of hydrated DTO objects :

image

I think it would be really interesting, more efficient and handier to build grids directly from an array of DTOs. I have a lot of troubles with standard doctrine entities and DQL. We had to create DB views.
I would be simpler than entities or vectors.
what do you think?

Can you help me editing the bundle to make it work with DTOs?

I'm currently working on this and i'm encoutering problems as the bundle expects a Doctrine Entity :
The class 'Mobilite\MainBundle\DTO\Consolidation\XXXXXXXXXDTO' was not found in the chain configured namespaces Mobilite\MainBundle\Entity, Mobilite\UserBundle\Entity, FOS\UserBundle\Model

Thanks a lot for your help!

@DonCallisto
Copy link
Member

@hmert could you or any other collaborator take a look at this? I'm currently engaged in test coverage and I cannot follow this, even for an evaluation.

Thanks.

@MaxandreOgeret
Copy link
Author

I think I should create a new source type (like Document, Entity or Vector) named "DTO"

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