我有一个自定义表格的扩展,其中一个我无法开始工作。当我尝试从中findOneByUid()
获取时,我似乎得到了正确的记录,但除了 from 之外uid
,pid
所有属性的值都是null
.
表的名称是:tx_myext_domain_model_advertisercategories
。我曾经在广告客户和类别之间有一个下划线,但似乎这是 extbase 期望的方式。
我已经配置:
- ext_tables.php & ext_tables.sql
- \Domain\Model\Advertisercategories.php
- \Domain\Repository\AdvertisercategoriesRepository.php
- \Configuration\TCA\Advertisercategories.php
我已将这些文件上传到 Github: https ://gist.github.com/kuipersb/4a5ef7f14ecc979866ae
执行findOneByUid()
或我的自定义方法时得到的输出searchAdvertiser()
如下:
object(VENDOR\MyExt\Domain\Model\Advertisercategories)[334]
protected 'advertiserId' => null
protected 'name' => null
protected 'uniqueCode' => null
protected 'discount' => null
protected 'uid' => int 1
protected '_localizedUid' => int 1
protected '_languageUid' => null
protected 'pid' => int 2
private '_isClone' (TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject) => boolean false
private '_cleanProperties' (TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject) =>
array (size=6)
'advertiserId' => null
'name' => null
'uniqueCode' => null
'discount' => null
'uid' => int 1
'pid' => int 2
但我希望:
advertiserId: 2
name: Test
unique_code: test
discount: 10.00
非常感谢任何帮助!