我有一个这样的命令控制器(使用 TYPO3 6.1):
class MyCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController {
/**
* fileRepository
*
* @var \VENDOR\MyExt\Domain\Repository\FileRepository
* @inject
*/
protected $fileRepository;
}
但是当我尝试演员
$this->fileRepository->findAll();
我得到:
Fatal error: Call to a member function findAll() on a non-object in
看起来存储库没有像在 ActionControllers 中那样使用 @inject 自动注入。
如何手动注入存储库?