extbase查询结果对象值为null

时间:2017-11-01 14:10:35

标签: typo3 extbase

我有一个扩展,适用于TYPO3 6.2和7.4。我尝试在TYPO3 8.7上运行ist。

问题是,除了uid和pid之外,我的数据库结果对象的值都是null。

我使用$ this-> subjectRepository-> findAll();我试图使用个人查询。结果是一样的。

$query = $this->createQuery();
$query->statement('SELECT * FROM tx_libconnect_domain_model_subject WHERE deleted = 0 AND hidden = 0');
$query->execute();

这是查询的转储:

TYPO3\CMS\Extbase\Persistence\Generic\Queryprototypeobject
   type => protected'Sub\Libconnect\Domain\Model\Subject' (35 chars)
   objectManager => protectedTYPO3\CMS\Extbase\Object\ObjectManagersingletonobjectfiltered
   dataMapper => protectedTYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMappersingletonobjectfiltered
   persistenceManager => protectedTYPO3\CMS\Extbase\Persistence\Generic\PersistenceManagersingletonobjectfiltered
   qomFactory => protectedTYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactorysingletonobjectfiltered
   source => protectedTYPO3\CMS\Extbase\Persistence\Generic\Qom\Selectorprototypeobject
      nodeTypeName => protected'Sub\Libconnect\Domain\Model\Subject' (35 chars)
      selectorName => protected'tx_libconnect_domain_model_subject' (34 chars)
   constraint => protectedNULL
   statement => protectedTYPO3\CMS\Extbase\Persistence\Generic\Qom\Statementprototypeobject
      statement => protected'SELECT * FROM tx_libconnect_domain_model_subject WHERE deleted = 0 AND hidde
         n = 0' (81 chars)
      boundVariables => protectedarray(empty)
   orderings => protectedarray(empty)
   limit => protectedNULL
   offset => protectedNULL
   querySettings => protectedTYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettingsprototypeobject
      respectStoragePage => protectedTRUE
      storagePageIds => protectedarray(1 item)
      ignoreEnableFields => protectedFALSE
      enableFieldsToBeIgnored => protectedarray(empty)
      includeDeleted => protectedFALSE
      respectSysLanguage => protectedFALSE
      languageOverlayMode => protected'1' (1 chars)
      languageMode => protected'content_fallback' (16 chars)
      languageUid => protected0 (integer)
      usePreparedStatement => protectedFALSE
      useQueryCache => protectedTRUE

在TYPO3 8.7上转储结果对象:

object(Sub\Libconnect\Domain\Model\Subject)#886 (10) { ["title":protected]=> NULL ["dbisid":protected]=> NULL ["ezbnotation":protected]=> NULL ["uid":protected]=> int(2) ["_localizedUid":protected]=> int(2) ["_languageUid":protected]=> NULL ["_versionedUid":protected]=> int(2) ["pid":protected]=> int(1) ["_isClone":"TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject":private]=> bool(false) ["_cleanProperties":"TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject":private]=> array(5) { ["title"]=> NULL ["dbisid"]=> NULL ["ezbnotation"]=> NULL ["uid"]=> int(2) ["pid"]=> int(1) } } 

在TYPO3 6.2上:

object(Sub\Libconnect\Domain\Model\Subject)#1078 (10) { ["title":protected]=> string(29) "Allgemein / Fachübergreifend" ["dbisid":protected]=> string(2) "28" ["ezbnotation":protected]=> string(2) "AZ" ["uid":protected]=> int(2) ["_localizedUid":protected]=> int(2) ["_languageUid":protected]=> NULL ["_versionedUid":protected]=> int(2) ["pid":protected]=> int(1) ["_isClone":"TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject":private]=> bool(false) ["_cleanProperties":"TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject":private]=> array(5) { ["title"]=> string(29) "Allgemein / Fachübergreifend" ["dbisid"]=> string(2) "28" ["ezbnotation"]=> string(2) "AZ" ["uid"]=> int(2) ["pid"]=> int(1) } }
你知道吗?非常感谢。

1 个答案:

答案 0 :(得分:1)

听起来TCA无效。 在最近的主要更新中,TCA有一些变化,例如:

  • 必填字段" renderType"使用选择时
  • 您必须使用tablename作为TCA定义的文件名
  • 您需要将每个表的TCA文件移动到文件夹Configuration / TCA

您可以在此处查看TCA参考:https://docs.typo3.org/typo3cms/TCAReference/