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

Roland most.wanted at gmx.at
Thu Nov 3 15:16:56 CET 2011


> 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();
> }
> }
> }

hi sebastian,

==========

QUESTION 1: how must the comment for this getter method look like? as 
far as i know it can be essential how exactly it looks.

--- quote ---

/**
  * Gets the first related zulassung (main zulassung)
  *
  * @return XYZ
  */

--- /quote ---

what about the @return?

==========

QUESTION 2: why did you mention "Maybe you can drop the instanceof 
validation"? what is the point here?

==========

kind regards.

roland


More information about the TYPO3-project-typo3v4mvc mailing list