gpt4 book ai didi

model - 如何在 TYPO3 和 extbase 中使用 crdate 和 cruser_id 等标准字段?

转载 作者:行者123 更新时间:2023-12-03 09:45:27 24 4
gpt4 key购买 nike

我有领域模型 Basket 和 Article。如果我调用以下电话,我会收到篮子里的文章。

$articlesInBasket = $basket->getArticles();

如何使用 TYPO3 标准属性,如 crdate 和 cruser_id。使用这样的东西会很好:
$basket->getCrUser();
$basket->getCrDate();

最佳答案

这适用于 TYPO3 8.7 和 9.5

模型:

/**
* @var \DateTime
*/
protected $crdate = null;


/**
* Returns the creation date
*
* @return \DateTime $crdate
*/
public function getCrdate()
{
return $this->crdate;
}

TCA -> 在列中添加它;
'columns' => [
'crdate' => [
'config' => [
'type' => 'passthrough',
],
],

...

]

关于model - 如何在 TYPO3 和 extbase 中使用 crdate 和 cruser_id 等标准字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13733546/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com