-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
PersistentCollection doesn't have the matching method #929
Comments
This feature isn't yet implemented. Quoting the 1.0 changelog:
|
Hi guys, any update on this issue? |
None besides what's written above. It's in the 1.x milestone, meaning we are willing to add it to one of the next 1.x releases, but nothing more than that. You could always help get things started by creating a pull request! |
I thought the custom collections feature made this less important?
…On 7 Dec 2016 5:23 pm, "Andreas" ***@***.***> wrote:
None besides what's written above. It's in the 1.x milestone, meaning we
are willing to add it to one of the next 1.x releases, but nothing more
than that. You could always help get things started by creating a pull
request!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#929 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAu3mPs1jYpa0mXYL-04fi0AZZzgHvd_ks5rFlDRgaJpZM4Cahuy>
.
|
+1 for having this feature I checked the ArrayCollection::matching() implementation, it can be implemented in a similar way in PersistentCollection I believe. Ideally using PersistentCollection's methods instead of array_*. But then few more methods needs to be implemented, i.e. PersistentCollection::reverse. What do you think? |
@svscorp I haven't taken a look in a while. Since you have an idea about how to implement it, could you create a pull request? |
I took a bit of a look at this yesterday night (about how it was implemented in ORM too). In ORM's I didn't take a proper look at how the persister is choosen yet. I guess the best to do would the same and query the referenced Document (for About the multiple persisters in ORM, Is there a need to add multiple persisters in ODM to differentiate the relations ? Do we have to change the Do we have to add new I still need to look a LOT of things; how (and where) the query to referenced Documents is made, to be able to add the Criteria to it ans surely other things. ps : Not related but there is a lot of methods with missing docBlock (return statement, param etc.), is that intentional ? ps2 : I wrote that quickly during a break, I maybe forgot some things or it may be a bit confusing. |
The implementation differs a lot from ORM. For one, we have a lot more flavours of associations than ORM. For example, for any owning-side collection, However, if we're dealing with a inverse reference-many that isn't loaded by a I've previously hacked this together but haven't found the time to polish it for inclusion in 2.0 - I can gladly hack it back in and push a WIP branch for others to pick up on. As for your question regarding a new |
Hey. If it's for 2.1 (or more) I guess it's not really urgent, then. I think I'll take a better look of the sources, to know how it works, for now. Once I know better about the sources, how it works etc, I could really help. (I'll have to take a really good look at the 2.x sources, as I only worked with 1.x until now) |
2.x is not very different except for coding standards and the low-level logic. Collections are very similar. As this feature won’t make it into 2.0 either way, there’s no need to hurry. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions. |
Both https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/PersistentCollection.php#L861 and https://github.com/doctrine/collections/blob/master/lib/Doctrine/Common/Collections/ArrayCollection.php#L358 (which is the type one needs to use on a ReferenceMany field) have a "matching" method for searching (via a Criteria) a set of items in the collections.
However - https://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/PersistentCollection.php (which is what returned on a ReferenceMany field) doesn't have that method.
How can I search in the ReferenceMany field ?
The text was updated successfully, but these errors were encountered: