[TYPO3-mvc] Left join query

Franz Koch typo3.RemoveForMessage at elements-net.de
Fri Jun 25 14:51:37 CEST 2010


Hi,

>>> /**
>>> *
>>> * @var Tx_BwShop_Domain_Model_Products
>>> * @lazy
>>>
>>> */
>>> protected $products;
...
>> Hm. Maybe it got lost, but from above you need to at least change your
>> annotations for $products:
>> ---
>> erm, as there is more then one product it would make sense to use an
>> objectStorage ;-)
> what should be my annotation? If I set it to objectStorage - is extbase
> going to return an array with all objects?

* @var Tx_Extbase_Persistence_ObjectStorage<Tx_BwShop_Domain_Model_Product>
* @lazy

> If you look at my previous e-mail the vard dump of $products is showing
> this:
> ["propertyName:private"]=>
> string(8) "products"
> ["fieldValue:private"]=>
> string(1) "7"
>
> what is FieldValue here? I'm asking because the products with the
> keyword searched for are exactly 7.

possible - as long as you don't have a annotation extbase can deal with 
you'll get the raw DB value - which in case of TYPO3 is the number of 
relations.

> Also even if I manage to show all products for a keyword I'm really
> concerned with the performance.
> For a single keyword I can have 10 000 products - is extbase going to
> return them all?

Yes, you will get ALL objects, as all objects are related to that 
keyword. If that doesn't work for you with having 10.000 products on a 
keyword, you have to find a different way, maybe by using a 
productsService returning only a limited subset of the assigned products 
using a special method of your productRepository (like 
$this->productRepository->findByKeyword($keyword, $offset, $limit)).

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list