mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #847] [CLOSED] Removed final from PersistentCollection #8790
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/847
Author: @maryo
Created: 11/15/2013
Status: ❌ Closed
Base:
master← Head:master📝 Commits (4)
601e5edUpdate PersistentCollection.php6129dc5Revert to13c1efb2401a9146aRemoved final from Queryfac288dReplaces hardcoded name of the class with static in EntityManager::create📊 Changes
108 files changed (+1551 additions, -2454 deletions)
View changed files
📝
.travis.yml(+1 -1)📝
README.markdown(+0 -1)📝
build.properties(+9 -1)📝
build.xml(+100 -87)📝
composer.json(+2 -5)➖
docs/en/cookbook/custom-mapping-types.rst(+0 -97)📝
docs/en/cookbook/dql-custom-walkers.rst(+1 -1)📝
docs/en/cookbook/resolve-target-entity-listener.rst(+3 -8)📝
docs/en/index.rst(+20 -22)📝
docs/en/reference/advanced-configuration.rst(+26 -62)📝
docs/en/reference/annotations-reference.rst(+1 -27)📝
docs/en/reference/association-mapping.rst(+252 -201)📝
docs/en/reference/basic-mapping.rst(+398 -210)📝
docs/en/reference/caching.rst(+1 -1)📝
docs/en/reference/configuration.rst(+6 -7)📝
docs/en/reference/dql-doctrine-query-language.rst(+2 -11)📝
docs/en/reference/events.rst(+52 -70)📝
docs/en/reference/faq.rst(+1 -1)📝
docs/en/reference/inheritance-mapping.rst(+0 -1)📝
docs/en/reference/native-sql.rst(+1 -1)...and 80 more files
📄 Description
I would like to be able to extend PersistentCollection. But it is final.
There is "@todo Design for inheritance to allow custom implementations?" in PersistentCollection.php.
Ofc it needs more modifications because the instantiation of PersistentCollections is hardcoded in UnitOfWork and ObjectHydrator classes. Creating something like PersistentCollectionFactory or persistentCollectionClass could solve it but there are already lots of dependencies in those classes. I can live with the hardoded state. I can somehow "hack" it so it will always replace PersistentCollection instances with my own which extends PersistentCollection when they are set. It's ugly but it could work..
So... At least removing the final statement helps me and could be a good start. Switching from private to protected for $em and $coll helps me also so i can read them in the descendant class but it can be "hacked" too even if i don't like hacks). Or getEntityManager() and getOriginalCollection() could be added.
If you can't accept this PR, let me know about the idea how "@todo Design for inheritance to allow custom implementations?" could be implemented and i will do it. If using a factory, class name or whatever.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.