1
做新的東西之前,我想我的調度任務從數據庫中刪除所有條目,在執行功能看起來像這樣:使用的removeAll()
public function execute() {
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$jobRepository = $objectManager->get('\TYPO3\MyExtension\Domain\Repository\JobRepository');
//clear DB
$jobRepository->removeAll();
(...)//insert new entries to DB
$objectManager->get('TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface')->persistAll();
return true;
}
插入新的條目到數據庫工作正常,但清理數據庫根本不起作用。我究竟做錯了什麼?
謝謝,那就是問題! – sinini