Skip to content

Define entities and fields as universalObjectCratesClasses? #929

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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