mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #5841] Embeddable value object #9753
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?
Original Pull Request: https://github.com/doctrine/orm/pull/5841
State: closed
Merged: No
Doctrine and Value Object (not Embeddable)
Many times I need to return with a
Value Objectfrom an Entity. Frequently we simply create the Value Object in the Entity`s getter. When we do, we add extra cost every time when we call the getter, because it always create a new instance of a VO + need to convert back and forth the value in the Entity's setter / getter.This PR add a
DoctrineValueObjectinterface to the project. If a Value Object implements this interface, doctrine will call theequalsmethod on the VO to compare instances instead of using the===comparison. Developer can define the rules how the changes has been determined.Example of usage: