src/Sulu/Bundle/ContactBundle/Controller/ContactController.php
private function prepareListResponse(DoctrineListBuilder $listBuilder, $locale)
    {
        $listResponse = $listBuilder->execute();
        $listResponse = $this->addAvatars($listResponse, $locale);

        $ids = $listBuilder->getIds();
        if (null !== $ids) {
            $comparator = $this->getComparator();
            // the @ is necessary in case of a PHP bug https://bugs.php.net/bug.php?id=50688
            @usort(
                $listResponse,
                function($a, $b) use ($comparator, $ids) {
                    return $comparator->compare($a['id'], $b['id'], $ids);
                }
            );
        }

        return $listResponse;
    }
private function prepareListResponse(DoctrineListBuilder $listBuilder, $locale)
    {
        $listResponse = $listBuilder->execute();
        $listResponse = $this->addAvatars($listResponse, $locale);

        $ids = $listBuilder->getIds();
        if (null !== $ids) {
            $comparator = $this->getComparator();
            // the @ is necessary in case of a PHP bug https://bugs.php.net/bug.php?id=50688
            @usort(
                $listResponse,
                function($a, $b) use ($comparator, $ids) {
                    return $comparator->compare($a['id'], $b['id'], $ids);
                }
            );
        }

        return $listResponse;
    }
private function prepareListResponse ( DoctrineListBuilder $ listBuilder , $ locale ) { $ listResponse = $ listBuilder -> execute ( ) ; $ listResponse = $ this -> addAvatars ( $ listResponse , $ locale ) ; $ ids = $ listBuilder -> getIds ( ) ; if ( null !== $ ids ) { $ comparator = $ this -> getComparator ( ) ; // the @ is necessary in case of a PHP bug https://bugs.php.net/bug.php?id=50688 @ usort ( $ listResponse , function ( $ a , $ b ) use ( $ comparator , $ ids ) { return $ comparator -> compare ( $ a [ 'id' ] , $ b [ 'id' ] , $ ids ) ; } ) ; } return $ listResponse ; }
Prepare list response.

@param DoctrineListBuilder $listBuilder
@param string $locale

@return array
Prepare list response .