[TYPO3-mvc] Howto check if object with a specific uid is related to an object (m:n relation)?

Roland most.wanted at gmx.at
Wed Nov 16 21:52:21 CET 2011


hey,

> what you do here is extending your object model with a property of
> something it can reach already. To me that doesn't sound too clean ;-)

ok, this sounds really not that clean. ;-)

> Since you already have the type related to your Download object, I would go
> for writing a viewhelper that returns true (or the string
> class="important") after giving it the objects of the download types and
> checking from within your viewhelper if it exists.

aah, i see. i have to give the objects to a viewhelper and get the needed
infotmation return. great!

> Thinking DDD: do you really need to have a m:n relationship from download
> to type? Can one download really have multiple types? I might not
> understand what you are trying to achieve, but if it can't, make it a n:1
> relationship (types can have multiple downloads, but a download can only
> have one type).

this is something you can discuss. i in the beginning designed n:1, but
wanted to be a little bit more flexible... i have got this feeling, that
there will be at least one further type that can then be added to a
download in addition...

> Then from within your downloads controller you can simply say
> {f:if(condition:download.downloadType.type=1, then:'class=Important')} ...

yes, this would then be less complicated.

kind regards.

roland


More information about the TYPO3-project-typo3v4mvc mailing list