Skip to content

Define entities and fields as universalObjectCratesClasses? #929

@mfb

Description

@mfb

Bug report

Entities and fields have magic getters and setters allowing them to store basically any property. This is used in core, for example adding a _referringItem property to an entity when it's referenced, and adding multiple database columns to a field.

So arguably, entity and field base classes/interfaces should be added to a universalObjectCratesClasses list? These would be Drupal\Core\Entity\EntityBase, Drupal\Core\Entity\EntityInterface (useful since variables/arguments are often typed to an interface), Drupal\Core\Field\FieldItemBase, Drupal\Core\Field\FieldItemInterface

Code snippet that reproduces the problem

Didn't make a code snippet yet but I could.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions