[TYPO3-mvc] Left join query

Daniel Dimitrov danielsd_bg at yahoo.fr
Mon Jun 28 12:36:36 CEST 2010


Thanks Nikolas!
My Tx_BwShop_Domain_Model_Keywords $keyword variable didn't have a javadoc 
comment.
I'm really happy! Thank you guys!!!! Now I get the all the products for a 
specific keyword.

I would like to use this thread to ask something more. What would be the 
syntax if I want extbase to find all products for an array of keywords?
I've build my Keywords Array like this:
Array
(
    [0] => Tx_BwShop_Domain_Model_Keywords Object
        (
            [keyword:protected] => Qualifizierung
            [products:protected] => Tx_Extbase_Persistence_LazyObjectStorage 
Object
                (
                    [parentObject:protected] => 
Tx_BwShop_Domain_Model_Keywords Object
 *RECURSION*
                    [propertyName:protected] => products
                    [fieldValue:protected] => 0
                    [isInitialized:protected] =>
                    [storage:protected] => Array
                        (
                        )

                    [isModified:protected] =>
                )

            [_cleanProperties:private] => Array
                (
                    [keyword] => Qualifizierung
                    [products] => Tx_Extbase_Persistence_LazyObjectStorage 
Object
                        (
                            [parentObject:protected] => 
Tx_BwShop_Domain_Model_Keywords Object
 *RECURSION*
                            [propertyName:protected] => products
                            [fieldValue:protected] => 0
                            [isInitialized:protected] =>
                            [storage:protected] => Array
                                (
                                )

                            [isModified:protected] =>
                        )

                    [uid] => 624
                )

            [uid:protected] => 624
            [_localizedUid:protected] => 624
            [_languageUid:protected] =>
            [_isClone:private] =>
        )

    [1] => Tx_BwShop_Domain_Model_Keywords Object
        (
            [keyword:protected] => Lernen
            [products:protected] => Tx_Extbase_Persistence_LazyObjectStorage 
Object
                (
                    [parentObject:protected] => 
Tx_BwShop_Domain_Model_Keywords Object
 *RECURSION*
                    [propertyName:protected] => products
                    [fieldValue:protected] => 7
                    [isInitialized:protected] =>
                    [storage:protected] => Array
                        (
                        )

                    [isModified:protected] =>
                )

            [_cleanProperties:private] => Array
                (
                    [keyword] => Lernen
                    [products] => Tx_Extbase_Persistence_LazyObjectStorage 
Object
                        (
                            [parentObject:protected] => 
Tx_BwShop_Domain_Model_Keywords Object
 *RECURSION*
                            [propertyName:protected] => products
                            [fieldValue:protected] => 7
                            [isInitialized:protected] =>
                            [storage:protected] => Array
                                (
                                )

                            [isModified:protected] =>
                        )

                    [uid] => 623
                )

            [uid:protected] => 623
            [_localizedUid:protected] => 623
            [_languageUid:protected] =>
            [_isClone:private] =>
        )

)

What should I change in my findByKeywords function?

	public function findByKeywords(Tx_BwShop_Domain_Model_Keywords $keyword, 
$limit=9999, $offset=0) {
		$query = $this->createQuery();
		return $query->matching(
						$query->contains('keywords', $keyword)
				)
				->setLimit((integer) $limit)
				->setOffset((integer) $offset)
				->execute();
	}


Is this at all possible?


"Nikolas Hagelstein" <lists at shr-now.de> wrote in message 
news:mailman.26842.1277718096.610.typo3-project-typo3v4mvc at lists.typo3.org...
> Hi,
>
>> I was using extbase 1.0.2 and contains was not existing. Now I've
>> udpated to
>> typo3 4.4 and extabse 1.2
>>
>> I get this Exception (for contains and equals):
>>
>> Tx_Extbase_Persistence_Exception_UnexpectedTypeException
>>
>> Could not determine the child object type.
>>
>> Does it means that my tca config is wrong???
> Double check your model annotations as well....
>
> Cheers,
> Nikolas

Kind Regards,
Daniel
>
>
 



More information about the TYPO3-project-typo3v4mvc mailing list