Skip to content

v0.20.86

Choose a tag to compare

@lkrms lkrms released this 03 Nov 02:25
· 1432 commits to main since this release
v0.20.86
69891ce

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 DeferredSyncEntity for on-demand resolution of deferred entities (similar to lazy hydration implemented via IteratorAggregate in DeferredRelationship)
    • Add Sync::resolveDeferred()
    • Allow deferred entities and relationships to be resolved via callback instead of assignment
    • Store resolved entities and relationships in DeferredSyncEntity and DeferredRelationship so 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 via getListA() in favour of resolving the first instance of each entity in its own context to ensure parent entities are surfaced to providers
  • 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 implementing getDefinition()
    • Add SyncProvider::run() to minimise the need for boilerplate safety checks in providers where sync operations are performed by declared methods
  • Sync: improve error reporting

    • Remove $toConsole parameter from Sync::error()
    • Add Sync::enableErrorReporting() and disableErrorReporting()
    • Fix issue where output from Sync::reportErrors() is not unescaped
  • Sync: rename classes and methods:

    • DeferredSyncEntity -> DeferredEntity
    • DeferredSyncEntityPolicy -> DeferralPolicy
    • SyncFilterPolicy -> FilterPolicy
    • Sync::getDeferredEntityCheckpoint() -> getDeferralCheckpoint()
    • ISyncContext::withDeferredSyncEntityPolicy() -> withDeferralPolicy()
    • ISyncContext::getDeferredSyncEntityPolicy() -> getDeferralPolicy()
  • Add optional $count parameter to Console::message{,Once}()

  • DbConnector: use DB2CODEPAGE to 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 SyncEntity and SyncEntityProvider
  • Remove references to DeferredSyncEntity::$Entity's unsupported nullability

Fixed

  • In ConsoleFormatter::escapeTags(), mitigate PREG_JIT_STACKLIMIT_ERROR when printing long Console messages with many special characters (e.g. JSON-encoded values) by only escaping recognised tag delimiters
  • Fix Event::listen() callback signature