Neos\Fusion\TypoScriptObjects\AbstractCollectionImplementation::prepareIterationInformation PHP Метод

prepareIterationInformation() защищенный Метод

protected prepareIterationInformation ( integer $collectionCount ) : array
$collectionCount integer
Результат array
    protected function prepareIterationInformation($collectionCount)
    {
        $iteration = array('index' => $this->numberOfRenderedNodes, 'cycle' => $this->numberOfRenderedNodes + 1, 'isFirst' => false, 'isLast' => false, 'isEven' => false, 'isOdd' => false);
        if ($this->numberOfRenderedNodes === 0) {
            $iteration['isFirst'] = true;
        }
        if ($this->numberOfRenderedNodes + 1 === $collectionCount) {
            $iteration['isLast'] = true;
        }
        if (($this->numberOfRenderedNodes + 1) % 2 === 0) {
            $iteration['isEven'] = true;
        } else {
            $iteration['isOdd'] = true;
        }
        return $iteration;
    }