Create interface for ContentEntityBase, ContentEntityBaseInterface

Created on 27 February 2025, 9 days ago

Problem/Motivation

Some methods in ContentEntityBase are not represented by any interface. This means that if I want to check that a variable is a class that I can safety call this method on, I need to check that the variable implements ContentEntityBase instead of being able to refer to an interface which other classes could also implement.

Example use case: I want to access a field value with $entity->field_myfield. I need to verify that this will work. There is no interface that defines ContentEntityBase::__get().

Proposed resolution

Create ContentEntityBaseInterface which would be implemented by ContentEntityBase.

Remaining tasks

Implement.

User interface changes

None.

Introduced terminology

None.

API changes

Creation of ContentEntityBaseInterface.

Data model changes

None.

Release notes snippet

📌 Task
Status

Active

Version

11.1 🔥

Component

entity system

Created by

🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024