[TYPO3-mvc] FLUID :: how can you access properties of m:n related objects?

Roland most.wanted at gmx.at
Thu Nov 3 11:03:18 CET 2011


> I would write a dedicated viewhelper or getter in your DomainModel to
> retrieve the first object.
> For the getter approach you can write something like that:
>
> public function getFirstZulassung() {
> $object = $this->getZulassungen() // Or whatever
> // Maybe you can drop the instanceof validation
> if($object instanceof Tx_Extbase_Persistence_ObjectStorage) {
> $object->rewind();
> if($object->valid()) {
> return $object->current();
> }
> }
> }

thanks sebastian,

please see my answer to henjos email in wich i refer to your email.

kind regards.

roland



More information about the TYPO3-project-typo3v4mvc mailing list