[PP-1] Add typehints and $throw_exception parameter to FieldableEntityInterface::get() and default to FALSE

Created on 1 May 2025, 15 days ago

Problem/Motivation

In 📌 Remove exception when accessing a non-existing field with ContentEntityInterface::get() Active , support for a second boolean parameter ($throw_exception) passed to get() on a FieldableEntityInterface object was added. This parameter is used to determine whether get() should thrown an exception when passed an invalid field name or return NULL. The deprecation warnings were added in the previous issue, and the default value of the parameter was set to TRUE, to maintain the same functionality as before.

In Drupal 12, the method signature needs to be updated to include the new parameter and remove the deprecation comments. The $field_name parameter should also have a typehint of string.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Postponed

Version

11.0 🔥

Component

entity system

Created by

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

Comments & Activities

Production build 0.71.5 2024