All notable changes to Neat Object components will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Typed property $createdAt must not be accessed before initialization.
- Implicit optional arguments.
- $key parameter to ReferenceFactory methods (breaks backward compatibility).
- Type hints (may break backward compatibility when you extend Neat Object classes, which is inherently bad).
- Generics documentation.
- Improved Relations efficiency by caching relations and references instead of builders.
- ReferenceBuilder setRemoteKeyString().
- setJunctionTableRemoteForeignKey() and setJunctionTableLocalForeignKey().
- build*() methods in the Relations trait and ReferenceFactory trait.
- Passing a Property instance to setLocalKey and setRemoteKey.
- RelationBuilder (the deprecated referenceFactory method was its only reason of existence)
- Doc-blocks.
- Support for PHP 8.1.
- Generics documentation.
- Storing & stored events were not dispatched.
- Generics documentation.
- Remove type hints for Storage::get() and Storage::One from. ?object does not work for phpstorm inspections either. Wait for php 8.0 so that we can use ?static as type hint.
- Change type hints for Storage::get() and Storage::One from ?self to ?object (fix phpstorm inspections)
- Events->triggerIfExists().
- EventDispatcher->triggerIfExists().
- Collection / Collectible documentation.
- Relation $configure parameter of type callable(ReferenceBuilder).
- Support for setting local and remote keys using property or column names as string.
- Relation accessor methods by using the Accessors trait.
- Policy accessorRelationMethod() to determine the relation targeted by calling an accessor.
- Policy constructor parameter $pluralize.
- ReferenceBuilder setRemoteKeyString() in favour of setRemoteKeyColumn().
- setJunctionTableRemoteForeignKey() in favour of setJunctionTableRemoteKeyColumn().
- setJunctionTableLocalForeignKey() in favour of setJunctionTableLocalKeyColumn().
- build*() methods in the Relations trait and ReferenceFactory trait.
- RelationBuilder->referenceFactory() in favour of $configuration parameter with Relations trait methods.
- Passing a Property instance to setLocalKey and setRemoteKey is deprecated.
- EventDispatcher->trigger() now throws if an event is not defined.
- Code coverage and brittle tests using the at() matcher.
- Events trait with trigger method.
- Repository layer method to get a specified layer from the repository decorator stack.
- RemoteKeyBuilder was missing the setRemoteRepository method.
- Type-hints & doc-blocks.
- RemoteKeyBuilder was missing methods.
- Collection sort method.
- Docblock typehints, optional parameters and correct query-builder type.
- Code-style optimizations.
- Event implementations: Creating, Created, Updating, Updated.
- Reference cache key collisions.
- PSR-14 Event Dispatcher support using repository decorator.
- Event implementations: Loading, Loaded, Storing, Stored, Deleting, Deleted.
- PHP 7.0 and PHP 7.1 support.
- The belongsToOne relation includes soft deleted entities.
- Support data to be merged in sql query when using Repository::sql().
- The property class can't handle types other than string use the adapters instead.
- Repository::one() method will now filter soft-deleted objects.
- Repository::sql() method and SQLQuery support.
- Property adapters to replace the switch statement.
- Build methods and builder classes for Relations and References.
- Policy now throws a ClassNotFoundException when the requested class cannot be found.
- Policy will use the static createFromArray method as custom factory when it exists.
- Adding multiple unsaved items to a many relation.
- Property->type() method.
- Repository can use a custom factory for creating an entity instance from array.
- Manager instance and create methods.
- Manager isset method.
- Manager get, set, setFactory and unset methods.
- Manager instance and create methods.
- #15 Multiple unpersisted objects can't be added to a many relation
- #13 Allow properties to be nullable (e.g. string|null)
- Remote key property and variable names
- Last method to the collectible trait
- Support for DateTimeImmutable type hint in entities
- Remove support for relations
- PHP 7.3 support
- Relations trait: manager method is now static
- Prevent adding double relations
- Remote key insert/update/delete algorithm