PhpOffice\PhpPresentation\Writer\AbstractWriter::iterateCollection PHP Method

iterateCollection() private method

private iterateCollection ( ArrayIterator $oIterator )
$oIterator ArrayIterator
    private function iterateCollection(\ArrayIterator $oIterator)
    {
        $arrayReturn = array();
        if ($oIterator->count() <= 0) {
            return $arrayReturn;
        }
        while ($oIterator->valid()) {
            $oShape = $oIterator->current();
            if ($oShape instanceof AbstractDrawingAdapter) {
                $arrayReturn[] = $oShape;
            } elseif ($oShape instanceof Chart) {
                $arrayReturn[] = $oShape;
            } elseif ($oShape instanceof Group) {
                $arrayGroup = $this->iterateCollection($oShape->getShapeCollection()->getIterator());
                $arrayReturn = array_merge($arrayReturn, $arrayGroup);
            }
            $oIterator->next();
        }
        return $arrayReturn;
    }