[TYPO3-english] "tt_content" group field + Extbase

Sergio Catalá scatala.enet at gmail.com
Fri Apr 11 17:29:25 CEST 2014


Hi list,

I created a new Extbase extension (6.2) to extend "tt_content" table 
with a new field. This TCA field is defined with "group" (db) type and 
allows to insert any record from the database. The TCA definition for 
this is:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
     'tt_content',
     array(
         'tx_myextension_records' => array (
             'exclude' => 0,
             'label' => 'LLL:EXT:cms/locallang_ttc.xlf:records',
             'config' => array(
                 'type' => 'group',
                 'internal_type' => 'db',
                 'allowed' => '*',
                 'prepend_tname' => '1',
                 'size' => '5',
                 'maxitems' => '200',
                 'minitems' => '0',
                 'show_thumbs' => '1',
                 'wizards' => array(
                     'suggest' => array(
                         'type' => 'suggest'
                     )
                 )
             )
         ),
     ),
     1
);

Note that "prepend_tname" is set to 1, which means every record inserted 
in the field, separated by commas, will be prepended with the table name.

Now I would like to get all these records from an Extbase controller and 
add them to an array, but I don't know how to get every record separately.

It is something like "Insert Records" CE does.

My content is of type "tt_content" but with a new CType.

I can do the next in my controller:

$currentTtContent = $this->configurationManager->getContentObject()->data;

And I can get the field separated by commas, but is there any function 
in Typo3 core to get all these records clean (objects with all the fields)?

I've been taking a look to: 
typo3/sysext/core/Classes/DataHandling/DataHandler.php
but without success.

Thanks in advance,
Sergio



More information about the TYPO3-english mailing list