src/Sulu/Bundle/PageBundle/Teaser/TeaserManager.php
private function sortTeasers(array $teasers, array $result, array $positions, array $items)
    {
        foreach ($teasers as $teaser) {
            $index = $positions[sprintf('%s;%s', $teaser->getType(), $teaser->getId())];
            $result[$index] = $teaser;

            $item = $items[$index];
            if (['type', 'id'] !== array_keys($item)) {
                $result[$index] = $result[$index]->merge($item);
            }
        }

        return $result;
    }
private function sortTeasers(array $teasers, array $result, array $positions, array $items)
    {
        foreach ($teasers as $teaser) {
            $index = $positions[sprintf('%s;%s', $teaser->getType(), $teaser->getId())];
            $result[$index] = $teaser;

            $item = $items[$index];
            if (['type', 'id'] !== array_keys($item)) {
                $result[$index] = $result[$index]->merge($item);
            }
        }

        return $result;
    }
private function sortTeasers ( array $ teasers , array $ result , array $ positions , array $ items ) { foreach ( $ teasers as $ teaser ) { $ index = $ positions [ sprintf ( '%s;%s' , $ teaser -> getType ( ) , $ teaser -> getId ( ) ) ] ; $ result [ $ index ] = $ teaser ; $ item = $ items [ $ index ] ; if ( [ 'type' , 'id' ] !== array_keys ( $ item ) ) { $ result [ $ index ] = $ result [ $ index ] -> merge ( $ item ) ; } } return $ result ; }
Returns sorted teaser by given position array.

@param Teaser[] $teasers
@param array $result
@param array $positions

@return array
Returns sorted teaser by given position array .