Database TYPO3 findAll()返回空数据

Database TYPO3 findAll()返回空数据,database,typo3,findall,Database,Typo3,Findall,我是打字新手。 我面临着这个问题,无法从数据库中获取数据 我有一个插件与此配置 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Locations.' . $_EXTKEY, 'Locationsfe', array( 'Location' => 'list, show, showprice, listprice, listcategory, scan,sharedoffice', 'Catego

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

我有一个插件与此配置

\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
}
}

但所有这些都不起作用。只需返回白色页面

我也读过这篇文章

那么,会发生什么?我不知道为什么。你能帮我弄清楚吗


提前感谢。

好的,我想您已经在后端的model type pricing中创建了一些记录(右;)。 然后,请在控制器中尝试以下操作:

$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());
你能把调试贴出来吗。
抱歉,我不能评论我没有正确的声誉:(

日志中有错误吗?Hi@Heinzschill:typo3日志中没有任何日志。这是apache中的错误日志[Thu Jul 13 23:45:30.297309 2017][:error][pid 6911][client 127.0.0.1:46974]PHP 18.print\r()/home/quangbv/www/website/typo3conf/ext/locations/Classes/Controller/PricingController.php:194,referer:如果这样,$pricing变量返回null或无效。谢谢。现在已经完成了。我尝试打印或变量转储,结果是空的。但是当我使用foreach时,然后打印每个项目。没关系。