0
我有我的CommandController,我用它來定義一個調度程序任務清理我的回購數據。出於某種原因,這是行不通的。我也無法添加()一個新元素到我的$ itemRepository(在這個commandcontroller內)。任何想法我失蹤了?Extbase CommandController任務刪除回購
<?php
namespace VENDX\Items\Command;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
class TestCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController
{
/**
* itemRepository
*
* @var \VENDX\Items\Domain\Repository\ItemRepository
* @inject
*/
protected $itemRepository;
/**
* @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
* @inject
*/
protected $persistenceManager;
/**
*
* @return void
*/
public function repoDeleteCommand() {
$this->$itemRepository->removeAll();
}
}
?>
你有你的持久性是上下文設置?通常這可以很容易地通過'module.tx_yourext
完成,它看起來不同:我在my_ext/Configuration/TypoScript/setup.txt中添加了'module.tx_items.persistence
d4ny3l