v0.20.86
Added
-
Sync: implement hydration of relationships
- Add
HydrationFlag - Allow hydration flags to be applied to sync contexts globally or per-entity
- Implement suppressed, lazy, deferred and eager hydration of relationships
- Apply parent/child relationships via
addChild()/setParent() - Register entities with the entity store before processing deferred entities and relationships to prevent race conditions and infinite recursion
- Add magic methods to
DeferredSyncEntityfor on-demand resolution of deferred entities (similar to lazy hydration implemented viaIteratorAggregateinDeferredRelationship) - Add
Sync::resolveDeferred() - Allow deferred entities and relationships to be resolved via callback instead of assignment
- Store resolved entities and relationships in
DeferredSyncEntityandDeferredRelationshipso they can forward property actions and method calls until they go out of scope - Throw an exception if an attempt is made to resolve the same deferred entity or relationship multiple times
- In
Sync::resolveDeferredEntities(), remove attempt to resolve multiple entities viagetListA()in favour of resolving the first instance of each entity in its own context to ensure parent entities are surfaced to providers
- Add
-
Sync: add protected
DbSyncProvider::first()method to simplify retrieval of a single entity -
Add
Convert::toValue() -
Add
Test::isFloatValue()
Changed
-
Sync: simplify filter policy API
- Add
ISyncProvider::getFilterPolicy()so providers can specify a default without implementinggetDefinition() - Add
SyncProvider::run()to minimise the need for boilerplate safety checks in providers where sync operations are performed by declared methods
- Add
-
Sync: improve error reporting
- Remove
$toConsoleparameter fromSync::error() - Add
Sync::enableErrorReporting()anddisableErrorReporting() - Fix issue where output from
Sync::reportErrors()is not unescaped
- Remove
-
Sync: rename classes and methods:
DeferredSyncEntity->DeferredEntityDeferredSyncEntityPolicy->DeferralPolicySyncFilterPolicy->FilterPolicySync::getDeferredEntityCheckpoint()->getDeferralCheckpoint()ISyncContext::withDeferredSyncEntityPolicy()->withDeferralPolicy()ISyncContext::getDeferredSyncEntityPolicy()->getDeferralPolicy()
-
Add optional
$countparameter toConsole::message{,Once}() -
DbConnector: useDB2CODEPAGEto enable UTF-8 before connecting to Db2 -
DbSyncProvider: remove UTF-8 locale assertion -
Convert/Test: accept leading and trailing spaces in integer and boolean strings
Removed
- Remove unused entity deferral methods from
SyncEntityandSyncEntityProvider - Remove references to
DeferredSyncEntity::$Entity's unsupported nullability
Fixed
- In
ConsoleFormatter::escapeTags(), mitigatePREG_JIT_STACKLIMIT_ERRORwhen printing longConsolemessages with many special characters (e.g. JSON-encoded values) by only escaping recognised tag delimiters - Fix
Event::listen()callback signature