3

次のような commandController を取得しました (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 で自動注入されていないようです。

リポジトリを手動で挿入するにはどうすればよいですか?

4

3 に答える 3

1

ユーザーまたはグループの TSConfig に以下を追加すると、インストール ツールだけでなく、右上隅の「フラッシュ」メニューからもシステム キャッシュをクリアできるようになります。

options.clearCache.system = 1
于 2015-02-03T11:03:18.447 に答える