Deprecation: #94377 - Extbase ObjectManager->getEmptyObject¶
Extbase has the odd behavior that
- typically classes in
Classes/Domain/Model of Extbase enabled
extensions - don't call
__construct when the persistence layer
"thaws" a model from database - typically when a Extbase
Domain/Repository uses a
As a side-effect of switching away from Extbase
symfony based dependency injection, this behavior will change in TYPO3 v12:
__construct() will be called in v12 when the
creates model instances from database rows.
There is no impact in TYPO3 v11 and no deprecation log entry is raised. However, extension developers should prepare toward this change in v11 to avoid any impact of a breaking change in v12.
Extbase extensions having domain models that implement
are affected. It is rather unlikely this has any impact on the behavior
of the extension, though.
Additionally, calls to API method
TYPO3\CMS\Extbase\Object\ObjectManager->getEmptyObject() should be
avoided since it will vanish in v12. The vast majority of extensions will
not do this, though. The extension scanner will find candidates.
No migration possible. Simply expect that
__construct() of a domain
model will be called in v12 when a domain repository
directly or indirectly reconstitutes a model object from a database row.