Neos.Fusion/Classes/FusionObjects/MapImplementation.php
public function evaluate()
    {
        $collection = $this->getItems();

        $result = [];
        if ($collection === null) {
            return $result;
        }
        $this->numberOfRenderedNodes = 0;
        $itemName = $this->getItemName();
        if ($itemName === null) {
            throw new FusionException('The Collection needs an itemName to be set.', 1344325771);
        }
        $itemKey = $this->getItemKey();
        $iterationName = $this->getIterationName();
        $collectionTotalCount = count($collection);

        $itemRenderPath = $this->path . '/itemRenderer';
        $fallbackRenderPath =  $this->path . '/content';
        if ($this->runtime->canRender($itemRenderPath) === false && $this->runtime->canRender($fallbackRenderPath)) {
            $itemRenderPath = $fallbackRenderPath;
        }

        foreach ($collection as $collectionKey => $collectionElement) {
            $context = $this->runtime->getCurrentContext();
            $context[$itemName] = $collectionElement;
            if ($itemKey !== null) {
                $context[$itemKey] = $collectionKey;
            }
            if ($iterationName !== null) {
                $context[$iterationName] = $this->prepareIterationInformation($collectionTotalCount);
            }

            $this->runtime->pushContextArray($context);
            $result[$collectionKey] =  $this->runtime->render($itemRenderPath);
            $this->runtime->popContext();
            $this->numberOfRenderedNodes++;
        }

        return $result;
    }
public function evaluate()
    {
        $collection = $this->getItems();

        $result = [];
        if ($collection === null) {
            return $result;
        }
        $this->numberOfRenderedNodes = 0;
        $itemName = $this->getItemName();
        if ($itemName === null) {
            throw new FusionException('The Collection needs an itemName to be set.', 1344325771);
        }
        $itemKey = $this->getItemKey();
        $iterationName = $this->getIterationName();
        $collectionTotalCount = count($collection);

        $itemRenderPath = $this->path . '/itemRenderer';
        $fallbackRenderPath =  $this->path . '/content';
        if ($this->runtime->canRender($itemRenderPath) === false && $this->runtime->canRender($fallbackRenderPath)) {
            $itemRenderPath = $fallbackRenderPath;
        }

        foreach ($collection as $collectionKey => $collectionElement) {
            $context = $this->runtime->getCurrentContext();
            $context[$itemName] = $collectionElement;
            if ($itemKey !== null) {
                $context[$itemKey] = $collectionKey;
            }
            if ($iterationName !== null) {
                $context[$iterationName] = $this->prepareIterationInformation($collectionTotalCount);
            }

            $this->runtime->pushContextArray($context);
            $result[$collectionKey] =  $this->runtime->render($itemRenderPath);
            $this->runtime->popContext();
            $this->numberOfRenderedNodes++;
        }

        return $result;
    }
public function evaluate ( ) { $ collection = $ this -> getItems ( ) ; $ result = [ ] ; if ( $ collection === null ) { return $ result ; } $ this -> numberOfRenderedNodes = 0 ; $ itemName = $ this -> getItemName ( ) ; if ( $ itemName === null ) { throw new FusionException ( 'The Collection needs an itemName to be set.' , 1344325771 ) ; } $ itemKey = $ this -> getItemKey ( ) ; $ iterationName = $ this -> getIterationName ( ) ; $ collectionTotalCount = count ( $ collection ) ; $ itemRenderPath = $ this -> path . '/itemRenderer' ; $ fallbackRenderPath = $ this -> path . '/content' ; if ( $ this -> runtime -> canRender ( $ itemRenderPath ) === false && $ this -> runtime -> canRender ( $ fallbackRenderPath ) ) { $ itemRenderPath = $ fallbackRenderPath ; } foreach ( $ collection as $ collectionKey => $ collectionElement ) { $ context = $ this -> runtime -> getCurrentContext ( ) ; $ context [ $ itemName ] = $ collectionElement ; if ( $ itemKey !== null ) { $ context [ $ itemKey ] = $ collectionKey ; } if ( $ iterationName !== null ) { $ context [ $ iterationName ] = $ this -> prepareIterationInformation ( $ collectionTotalCount ) ; } $ this -> runtime -> pushContextArray ( $ context ) ; $ result [ $ collectionKey ] = $ this -> runtime -> render ( $ itemRenderPath ) ; $ this -> runtime -> popContext ( ) ; $ this -> numberOfRenderedNodes ++ ; } return $ result ; }
Evaluate the collection nodes as array

@return array
@throws FusionException
Evaluate the collection nodes as array