Issue Task Under Review

#111657Move AbstractDomainObject property name constants to DomainObjectProperty

Alexander Schnitzler 11/29/26, 13:03 updated 11/29/26, 13:16

Description

AbstractDomainObject defines the names of the framework properties as constants (PROPERTY_UID, PROPERTY_PID, PROPERTY_LOCALIZED_UID, PROPERTY_LANGUAGE_UID, PROPERTY_VERSIONED_UID). The persistence layer (DataMapper, Backend, Typo3DbQueryParser, Typo3DbBackend, CleanStateTracker, ExtbaseHistoryTracker) uses them, so it has to reference the base class of the models just to know the name of a property.

Proposal

Add a new final class TYPO3\CMS\Extbase\DomainObject\DomainObjectProperty that only holds the constants:

  • DomainObjectProperty::UID
  • DomainObjectProperty::PID
  • DomainObjectProperty::LOCALIZED_UID
  • DomainObjectProperty::LANGUAGE_UID
  • DomainObjectProperty::VERSIONED_UID

The class cannot be instantiated or cloned (private constructor and __clone()); it is only a container for the constants.

The name is deliberately not just Property: TYPO3\CMS\Extbase\Reflection\ClassSchema\Property already exists and is imported in the same persistence classes, which would force import aliases there and in extensions.

Deprecation

The constants in AbstractDomainObject stay for one major version and point to the new ones (public const string PROPERTY_UID = DomainObjectProperty::UID; etc.). They are marked deprecated and removed in v16. An extension scanner entry detects direct usage; access through subclasses (AbstractEntity::PROPERTY_UID, MyModel::PROPERTY_UID, self::/@static::@) is not detected.

Core code switches to DomainObjectProperty::*.

Reviews 1

History 12

  1. Alexander Schnitzler changed subject Move AbstractDomainObject property name constants to DomainObject\Property Move AbstractDomainObject property name constants to DomainObjectProperty description 11/29/26, 13:13

  2. Gerrit Code Review pushed patch set 1 for main to change 98193 status New Under Review 11/29/26, 13:16