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

DDC-3622: [GH-1336] Fix UoW warning with custom id object types #4448

Closed
doctrinebot opened this issue Mar 17, 2015 · 2 comments
Closed

DDC-3622: [GH-1336] Fix UoW warning with custom id object types #4448

doctrinebot opened this issue Mar 17, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of stefanotorresi:

Url: #1336

Message:

UnitOfWork::tryGetById() and UnitOfWork::tryGetByIdHash() may receive an object as an id, for instance when using a custom id type like Rhumsaa\Uuid.

This PR adds a simple cast to string in these methods.

There are a couple of things I'm not sure about, tho.

First of all, I don't know if functional tests alone are deemed sufficient, but I couldn't figure out how to replicate the issue via unit tests only (apart from directly invoking the two methods above with an object as argument, which looks a bit pointless).

Furthermore, I don't know if the cast should be applied elsewhere; so far the only cases I stumbled upon where common find and fetch joins, but I saw other methods where it may be necessary (i.e. here and here), but I couldn't replicate the code path to reach those.
Also I wonder if an exception should be thrown if the id object doesn't implement **toString(), and in this case if the fix should be refactored into Doctrine\ORM\Utility\IdentifierFlattener, for a bit of SoC.

Let me know what you think.

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1336] was closed:
#1336

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

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

2 participants