繁体   English   中英

TYPO3 findAll()返回空数据

[英]TYPO3 findAll() return empty data

我是TYPO3的新手。 我面临着这个问题,无法从数据库中获取数据。

我有一个带有此配置的插件

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Locations.' . $_EXTKEY,
'Locationsfe',
array(
    'Location' => 'list, show, showprice, listprice, listcategory, scan,sharedoffice',
    'Category' => 'list, show',
    'Pricing' => 'list, show, showprice, listprice, scan, test',
    'Template' => 'list, show',
),
// non-cacheable actions
array(
    'Location' => '',
    'Category' => '',
    'Pricing' => 'test',
    'Template' => '',
)

);

在我的控制器中,我有此功能

public function testAction() {
    // Get current language
    $currentLanguage = $GLOBALS['TSFE']->sys_language_uid;
    $pricing = $this->pricingRepository->findAll();
    print_r($pricing);
    die('Passed');
}

我也将此行添加到了常量

plugin.tx_locations.persistence.storagePid = 164

我还创建了一个打字错误脚本

plugin.tx_locations {
view {
    templateRootPath = {$plugin.tx_locations.view.templateRootPath}
    partialRootPath = {$plugin.tx_locations.view.partialRootPath}
    layoutRootPath = {$plugin.tx_locations.view.layoutRootPath}
}
persistence {
    storagePid = 164
}
features {
    # uncomment the following line to enable the new Property Mapper.
    # rewrittenPropertyMapper = 1
}

}

但以上所有方法均无效。 只是白页返回。

我还阅读了这个extbase存储库findAll()返回结果为null

那么,会发生什么呢? 我不知道为什么 你能帮我解决一下吗。

提前致谢。

好的,我想您已经在您的后端权限()中从模型类型定价创建了一些记录。 然后,请在您的控制器中尝试以下操作:

$this->pricingRepository->setDefaultQuerySettings($this->pricingRepository->createQuery()->getQuerySettings()->setRespectStoragePage(false)); /* here we ignore the storage pid to be sure that we look in the entire system, if this works we have some hints that somthing with the storage pid is wrong */
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($this->pricingRepository); /*please use this for debugging is much easier with this :D*/
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($this->pricingRepository->findAll());

您可以发布调试信息吗? 对不起,我不能发表评论,我没有正确的声誉:(

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM