src/Sulu/Bundle/PageBundle/Teaser/TeaserManager.php
private function sortItems($items)
    {
        $ids = [];
        $positions = [];
        $index = 0;
        foreach ($items as $item) {
            if (!array_key_exists($item['type'], $ids)) {
                $ids[$item['type']] = [];
            }
            $ids[$item['type']][] = $item['id'];
            $positions[sprintf('%s;%s', $item['type'], $item['id'])] = $index++;
        }

        return [$ids, $positions];
    }
private function sortItems($items)
    {
        $ids = [];
        $positions = [];
        $index = 0;
        foreach ($items as $item) {
            if (!array_key_exists($item['type'], $ids)) {
                $ids[$item['type']] = [];
            }
            $ids[$item['type']][] = $item['id'];
            $positions[sprintf('%s;%s', $item['type'], $item['id'])] = $index++;
        }

        return [$ids, $positions];
    }
private function sortItems ( $ items ) { $ ids = [ ] ; $ positions = [ ] ; $ index = 0 ; foreach ( $ items as $ item ) { if ( ! array_key_exists ( $ item [ 'type' ] , $ ids ) ) { $ ids [ $ item [ 'type' ] ] = [ ] ; } $ ids [ $ item [ 'type' ] ] [ ] = $ item [ 'id' ] ; $ positions [ sprintf ( '%s;%s' , $ item [ 'type' ] , $ item [ 'id' ] ) ] = $ index ++ ; } return [ $ ids , $ positions ] ; }
Returns items sorted by type.

@param array $items

@return array
Returns items sorted by type .