Newscoop\GimmeBundle\Controller\ArticlesListController::linkToPlaylistAction PHP Method

linkToPlaylistAction() public method

** articles headers**: header name: "link" header value: "" or with specific language header value: "" you can also specify position on list header value: ",<1; rel="article-position">"
public linkToPlaylistAction ( Request $request, $id )
$request Symfony\Component\HttpFoundation\Request
    public function linkToPlaylistAction(Request $request, $id)
    {
        $em = $this->container->get('em');
        $user = $this->container->get('user')->getCurrentUser();
        if (!$user->hasPermission('ManagePlaylist')) {
            throw new AccessDeniedException('You do not have the right to manage playlists.');
        }
        $playlist = $em->getRepository('Newscoop\\Entity\\Playlist')->getPlaylist($id)->getOneOrNullResult();
        if (!$playlist) {
            throw new NotFoundHttpException('Result was not found.');
        }
        $this->linkOrUnlinkResources($playlist, $request, 'link');
        return $playlist;
    }