title | issue |
---|---|
Integrate custom entities |
NEXT-16225 |
- Changed
ArrayEntity::getVars()
, so that thedata
property is no longer in the payload but applied to theroot
level. - Added
{app}/Resources/entities.xml
file, which allows to define custom entities inside apps. - Changed
entitiyClass
expectation inside all fields and reference of entity definitions. It is now possible to provide the entity name instead - Added new api endpoint
/api/custom-entity-{entityName}*
to handle crud api operations for all custom entities - Added new domain
Core/System/CustomEntity
which contains all new classes for custom entities implementation, this includes:- database schema operations
- XML parsing
- DAL extensions
-
The
ArrayEntity::getVars()
has been changed so that thedata
property is no longer in the payload but applied to theroot
level.- This change affects all entity definitions that do not have their own entity class defined.
- The API routes should not be affected, because they did not work with an ArrayEntity before the change, so no before/after payload can be shown.
- before
$entity = new ArrayEntity(['foo' => 'bar']); assert($entity->getVars(), ['data' => ['foo' => 'bar'], 'foo' => 'bar']);
- after
$entity = new ArrayEntity(['foo' => 'bar']); assert($entity->getVars(), ['foo' => 'bar']);