src/Sulu/Bundle/SnippetBundle/Controller/SnippetController.php
private function decorateSnippet(array $snippet, $locale)
    {
        return array_merge(
            $snippet,
            [
                '_links' => [
                    'self' => $this->urlGenerator->generate(
                        'get_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                    'delete' => $this->urlGenerator->generate(
                        'delete_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                    'new' => $this->urlGenerator->generate('post_snippet', ['language' => $locale]),
                    'update' => $this->urlGenerator->generate(
                        'put_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                ],
            ]
        );
    }
private function decorateSnippet(array $snippet, $locale)
    {
        return array_merge(
            $snippet,
            [
                '_links' => [
                    'self' => $this->urlGenerator->generate(
                        'get_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                    'delete' => $this->urlGenerator->generate(
                        'delete_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                    'new' => $this->urlGenerator->generate('post_snippet', ['language' => $locale]),
                    'update' => $this->urlGenerator->generate(
                        'put_snippet',
                        ['id' => $snippet['id'], 'language' => $locale]
                    ),
                ],
            ]
        );
    }
private function decorateSnippet ( array $ snippet , $ locale ) { return array_merge ( $ snippet , [ '_links' => [ 'self' => $ this -> urlGenerator -> generate ( 'get_snippet' , [ 'id' => $ snippet [ 'id' ] , 'language' => $ locale ] ) , 'delete' => $ this -> urlGenerator -> generate ( 'delete_snippet' , [ 'id' => $ snippet [ 'id' ] , 'language' => $ locale ] ) , 'new' => $ this -> urlGenerator -> generate ( 'post_snippet' , [ 'language' => $ locale ] ) , 'update' => $ this -> urlGenerator -> generate ( 'put_snippet' , [ 'id' => $ snippet [ 'id' ] , 'language' => $ locale ] ) , ] , ] ) ; }
Decorate snippet for HATEOAS.
Decorate snippet for HATEOAS .