Task #94961
openAdd automatic mapping for tstamp and crdate fields
0%
Description
Many users are struggling getting the DB columns tstamp
and crdate
mapped with their domain model.
What they do is adding a member field to their domain model and corresponding getter:
/** * tstamp * @var int */ protected $tstamp = 0; public function getTstamp(): int { return $this->tstamp }
as they do with all their other fields, but this never works and they keep asking about the way to go in the Slack channel.
The solution is straightforward when one knows about it: it's all about adding the "missing" TCA definition for tstamp
as a passthrough
and that's it.
Suggestion¶
Common columns such as
crdate
tstamp
(possibly others as well)
should be automatically configured as passthrough
if they are not already defined (e.g., when a developer configures the tstamp
with a custom renderer to show the last modification to their editors).
This would be the most straightforward I'd say.
Alternatively, Extbase could be taught about those fields.
Rationale¶
Getting those creation and modification dates into one's domain model is a really common use case. Struggling getting those dumb information mapped is hurting the developer experience.
No data to display