[TYPO3-mvc] MM Relation in matching()
Sebastian Fischer
typo3 at fischer.im
Thu Sep 17 20:53:28 CEST 2009
Jochen Rau schrieb:
> Hi Sebastian.
>
> Sebastian Fischer wrote:
>> my current problem is, that i want to select videos by given category.
>> No i don't see how to get a constraint that returns me the wished
>> records.
>>
>> So structure is like video, mmtable, category. In TCA everything is fine
>> and i can choose the category in the video. But i dont see who to set
>> the matching.
>
> Let's assume your Video has a property "category" holding (references
> to) Category instances and there is a VideoRepository.
>
> Did you try
> $videos = $videoRepository->findByCategory($category);
>
> Regards
> Jochen
>
Well actually it not a direkt reference
its more like
video {
uid,
title,
categories
}
video_category_mm {
uid_local -> video.uid,
uid_foreign -> category.uid
}
category {
uid,
name
}
so a findByCategory doesnt work like that.
Greetings
Sebastian
More information about the TYPO3-project-typo3v4mvc
mailing list