Task #94961

Add automatic mapping for tstamp and crdate fields

Added by Xavier Perseguers 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2021-08-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

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

Also available in: Atom PDF