Provides a thin layer that sits above Doctrine events to help you reconstitute/hydrate your entities. It lets you augment Doctrine's hydration with your logic in a concise and expressive class.
MIT License
This library provides a thin layer that sits above Doctrine events to help you reconstitute/hydrate your entities. It lets you augment Doctrine's hydration with your logic in a concise and expressive class.
After Doctrine hydrates an object from the database, this framework gives you the control to hydrate additional properties not handled by Doctrine, without having to deal with the peculiarities of Doctrine events and Unit of Work. Then, after Doctrine persists the changes to the database, it lets you do similarly with the properties.
The most common case of this type of tasks is for handling file uploads, of which many specialized libraries have already been written. But plenty of other cases exist:
These days we usually call the process hydration. Reconstitution is the term used by Eric Evans in "Domain-Driven Design: Tackling Complexity in the Heart of Software".
get()
and set()
methods as a convenience.get()
and set()
methods are forwarders to a custom implementation ofPropertyAccessorInterface
. Therefore, you can use the samePropertyAccessorInterface
.flush()
-ing. i.e. your$lastUpdated
— just to make sure the correct Doctrine event will be fired.MIT
Issues and pull requests should be filed in the GitHub repository rekalogika/reconstitutor.