【发布时间】:2019-12-14 19:39:03
【问题描述】:
我在我的扩展程序中使用“processDatamap_afterDatabaseOperations”挂钩将内容从新创建的新闻 (tx_news_domain_model_news) 传输到 API。
TYPO3 版本是 6.2.11,如果我 var_dump 或尝试使用 $record->getCategories() 访问类别,它是空的。与相关文件相同,falmedia 有效。这是我的代码:
public function processDatamap_afterDatabaseOperations($status, $table, $id, array $fieldArray, \TYPO3\CMS\Core\DataHandling\DataHandler &$pObj) {
if ($table == 'tx_news_domain_model_news' && $status == 'new') {
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$news = $objectManager->get('GeorgRinger\News\Domain\Repository\NewsRepository');
$record = $news->findByUid($pObj->substNEWwithIDs[$id]);
希望有人知道我在这里做错了什么。我一直在尝试这个,但没有得到它。
提前感谢您的帮助。
【问题讨论】:
标签: typo3 typo3-6.2.x typo3-extensions tx-news