[DDC-1819][WIP] Arbitrary object hydrator#348
Closed
marijn wants to merge 3 commits intodoctrine:masterfrom
Closed
[DDC-1819][WIP] Arbitrary object hydrator#348marijn wants to merge 3 commits intodoctrine:masterfrom
marijn wants to merge 3 commits intodoctrine:masterfrom
Conversation
The model consists of two entities: Customer and Address. The models are linked to one another through a one to one relationship that is owned by the customer. There third object represents the combined data for both models. This CustomerAddressView object will be used to test the arbitrary object hydration.
The suite contains a single test which mimics a query spanning two tables.
This results in the following API:
$rsm = new Doctrine\ORM\Query\ResultSetMapping();
// Create the result set mapping
$query = $em->createNativeQuery($sql, $rsm);
$objects = $query->getResult(Doctrine\ORM\Query::HYDRATE_ARBITRARY_OBJECT);
Author
|
I think it would be better to create a separate method for mapping arbitrary objects. |
Member
|
why? |
Member
|
@marijn as discussed 2 days ago, I don't really think your use case is valid. Anyway, I'd try another way, which is making up a |
This was referenced Dec 6, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial work (in progress) on a test suite for the arbitrary object hydrator, as discussed in DDC-1819. Any tips are appreciated. I'm not too sure what the test suite should and should not cover.
Other questions I have include:
HYDRATE_ARBITRARY_OBJECTconstant be added to theAbstractQueryclass or theNativeQueryclass? It only makes sense in the former but it might be missed when more constants are added in the future...DDC1819namespace?