I have an extbase extension, where I have a model A with a relation to another model B. Model B has a lot of entries, so I dont want to assign every single value by clicking on it. So it would be nice if I would have a possibility to somehow select all entries.
I tried to do this like in the page settings the "Usergroup Accsess Rights" area (http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#columns-select-examples-multiple). To have mixed values (static and dynamic) the field has to be a CSV field. I use an itemsProcFunc, where i build my array and put the static value in. The "All Entries" entry has a -1 id.
BACKEND FORM OF MODEL A
Field of modal A Model B values
_______________________ _______________________
|All Entries | | All Entries |
| | |-----------------------|
| | | First |
| | | Second |
| | | Third |
| | | Fourth |
| | | ... |
|_______________________| |_______________________|
TCA of Model A for the field of Model B relations
$TCA['tx_myext_domain_model_promotion']['columns']['relToB'] = array(
'exclude' => 0,
'label' => relToB,
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_myext_domain_model_modelB',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
'itemsProcFunc' => 'myFunc',
'exclusiveKeys' => '-1',
),
);
So far so good, this is working now and i get the selected "All Entries" value in my DB. But now the problem is, that the extbase property mapping functionality is broken and I have to write manual SQL everywhere I used this field.
How would you solve this issue? Is there an other way to get the "Select all entries" use case solved?