[TYPO3-dev] The extbase dilemma

Peter Niederlag typo3-list at niekom.de
Thu May 19 10:03:27 CEST 2011


Hello,

Am 18.05.2011 22:27, schrieb Daniel Brün:
> Hi Jochen,
[...]
>> What do you mean by "basic queries"?
>>
>
> Anything that would translate to more than SELECT * or INNER JOIN. Something
> like GROUP BY, or LEFT OUTER JOIN, or anything that results not in a plain
> domain object but really should be a composite object (doctrine and propel
> allow for such queries, and they provide a means to map the result to
> objects).

It shouldn't be to hard for all those smart & talented developers that 
are joining in this thread to get just that done, a simple 'map row to 
object' API that you can feed with raw queries that returns the proper 
domain objects.

BTW.: You can even just map to stdClass and use it as object in fluid, I 
do this for example to fill dropdowns without to much overhead 
(accessing arrays in fluid is sometimes tricky IMO). [1] ;)

While I see there are use cases for such complex scenarious (compound 
objects, GROUP BY,...) I'd say this is beyond most of the average 
extensions needs and can be handled properly by simple manual code.

[...]

Greets,
Peter

[1]
// create a dummy empty "all" element
$emptyItem = new stdClass();
$emptyItem->lable = 'alle';
$emptyItem->value = '';

// create date options
$filterDates = Tx_Geniale_Domain_EventDays::getObjectItemsByValues();
array_unshift($filterDates, $emptyItem);

// assign options to the view
$this->view->assign('filterDates', $filterDates);
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *




More information about the TYPO3-dev mailing list