Because there are many breaking changes an upgrade is not that easy. There are many edge cases this guide does not cover. We accept PRs to improve this guide.
High impact changes
- Please check the most recent
data.php
config file and change yours accordingly - The
Cast
interface now has a$context
argument in thecast
method - The
RuleInferrer
interface now has aRulesCollection
argument instead of anarray
- By default, it is now impossible to include/exclude properties using a request parameter until manually specified. This behaviour can be overwritten by adding these methods to your data object:
public static function allowedRequestIncludes(): ?array
{
return null;
}
public static function allowedRequestOnly(): ?array
{
return null;
}
- The
validate
method on a data object will not create a data object after validation, usevalidateAndCreate
instead DataCollection
is now being split into aDataCollection
,PaginatedDataCollection
andCursorPaginatedDataCollection
Low impact changes
- If you were using the inclusion and exclusion trees, please update your code to use the partialTrees
- The
DataProperty
andDataClass
structures are completely rewritten DataProperty
types is removed in favor ofDataType
- The
transform
method signature is updated onData
andDataCollection
- The
Lazy
class is now split intoDefaultLazy
,ConditionalLazy
andRelationalLazy
all implementingLazy
- If you were directly using Resolvers, please take a look, they have changed a lot
- The
DataTypeScriptTransformer
is updated for this new version, if you extend this then please take a look - The
DataTransformer
andDataCollectionTransformer
now use aWrapExecutionType
- The
filter
method was removed from paginated data collections - The
through
andfilter
operations on aDataCollection
will now happen instant instead of waiting for the transforming process