Skip to content

Latest commit

 

History

History
30 lines (29 loc) · 1.42 KB

2022-02-24-integrate-custom-entities.md

File metadata and controls

30 lines (29 loc) · 1.42 KB
title issue
Integrate custom entities
NEXT-16225

Core

  • Changed ArrayEntity::getVars(), so that the data property is no longer in the payload but applied to the root 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

Next Major Version Changes

ArrayEntity::getVars():

  • The ArrayEntity::getVars() has been changed so that the data property is no longer in the payload but applied to the root 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']);