[TYPO3-mvc] tx_extbase_type ignored?
Tomita Militaru
militarutomita at gmail.com
Fri May 17 10:15:42 CEST 2013
Hi Anja,
>
> how should this work out of the box? Extension Builder can not know
> you want to use Single Table Inheritence. Here is what you need, have
> a look into Extbase Implementation of Fe_Users and Fe_UserGroups for
> more details:
>
> TypoScript (see extbase/ext_typoscript_setup.txt):
> config.my_ext.persistence {
> classes {
> <Classname_of_class_B> {
> mapping {
> tableName = tx_myext_domain_model_space
> recordType = <whatever you choose here>
> }
> }
> }
> }
I have this typoscript already.
>
> TCA (see extbase/ext_tables.php):
> missing tablefield (probably in sql too)
> t3lib_div::loadTCA('fe_users');
> if (!isset($TCA['fe_users']['ctrl']['type'])) {
> $tempColumns = array(
> 'tx_extbase_type' => array(
> 'exclude' => 1,
> 'label' =>
> 'LLL:EXT:extbase/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type',
>
> 'config' => array(
> 'type' => 'select',
> 'items' => array(
>
> array('LLL:EXT:extbase/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type.0',
> '0'),
>
> array('LLL:EXT:extbase/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type.Tx_Extbase_Domain_Model_FrontendUser',
> 'Tx_Extbase_Domain_Model_FrontendUser')
> ),
> 'size' => 1,
> 'maxitems' => 1,
> 'default' => '0'
> )
> )
> );
> t3lib_extMgm::addTCAcolumns('fe_users', $tempColumns, 1);
> t3lib_extMgm::addToAllTCAtypes('fe_users', 'tx_extbase_type');
> $TCA['fe_users']['ctrl']['type'] = 'tx_extbase_type';
> }
> $TCA['fe_users']['types']['Tx_Extbase_Domain_Model_FrontendUser'] =
> $TCA['fe_users']['types']['0'];
I have this also in my ext_tables.php and the field tx_extbase_type is
in the table. The records have the correct tx_extbase_type set, I've
looked into it.
The only problem is when I fetch the records, I get all records of all
tx_extbase_type(s).
Thanks.
More information about the TYPO3-project-typo3v4mvc
mailing list