【发布时间】:2018-03-21 04:50:25
【问题描述】:
我想不时使用命令控制器中的存储库来执行一个过程。我在动作控制器和命令控制器中注入了存储库,存在对象但在命令控制器中返回空。
我在两个地方使用下一个代码,Action 和 Command。
/**
* postRepository
*
* @var \VENDOR\MyExt\Domain\Repository\PostRepository
* @inject
*/
protected $postRepository = null;
....
....
$posts = $this->postRepository->findAll();
\TYPO3\CMS\Core\Utility\DebugUtility::debug($posts, 'posts');
还有调试的那一刻。在动作控制器中我得到
TYPO3\CMS\Extbase\Persistence\Generic\QueryResultprototypeobject(5 项)
在命令控制器中
TYPO3\CMS\Extbase\Persistence\Generic\QueryResultprototypeobject(空)
在命令控制器中使用存储库的正确方法是什么,或者我如何获取其中的对象?
我在安装工具中使用 TYPO3 7.6、PHP 5.6 和 APC 缓存,并在服务器 Centos 6 中配置它
【问题讨论】:
标签: php typo3 extbase typo3-7.6.x