original_string: public function disableAction($id)
      {
          $em = $this->getDoctrine()->getManager();
  
          /** @var Actor $entity */
          $entity = $em->getRepository('CoreExtraBundle:Actor')->find($id);
  
          if (!$entity) {
              throw $this->createNotFoundException('Unable to find Actor  entity.');
          }
          
          $user = $this->get('security.token_storage')->getToken()->getUser();
          if (!$user->isGranted('ROLE_ADMIN')) {
              return $this->redirect($this->generateUrl('coreextra_newsletter_index'));
          }
          
          $entity->setNewsletter(false);
          $em->flush();
  
          $this->get('session')->getFlashBag()->add('success', 'newsletter.subscripts.disable');
  
          return $this->redirect($this->generateUrl('coreextra_newsletter_subscription'));
          
      }
code: public function disableAction($id)
      {
          $em = $this->getDoctrine()->getManager();
  
          /** @var Actor $entity */
          $entity = $em->getRepository('CoreExtraBundle:Actor')->find($id);
  
          if (!$entity) {
              throw $this->createNotFoundException('Unable to find Actor  entity.');
          }
          
          $user = $this->get('security.token_storage')->getToken()->getUser();
          if (!$user->isGranted('ROLE_ADMIN')) {
              return $this->redirect($this->generateUrl('coreextra_newsletter_index'));
          }
          
          $entity->setNewsletter(false);
          $em->flush();
  
          $this->get('session')->getFlashBag()->add('success', 'newsletter.subscripts.disable');
  
          return $this->redirect($this->generateUrl('coreextra_newsletter_subscription'));
          
      }
code_tokens: public function disableAction ( $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; /** @var Actor $entity */ $ entity = $ em -> getRepository ( 'CoreExtraBundle:Actor' ) -> find ( $ id ) ; if ( ! $ entity ) { throw $ this -> createNotFoundException ( 'Unable to find Actor  entity.' ) ; } $ user = $ this -> get ( 'security.token_storage' ) -> getToken ( ) -> getUser ( ) ; if ( ! $ user -> isGranted ( 'ROLE_ADMIN' ) ) { return $ this -> redirect ( $ this -> generateUrl ( 'coreextra_newsletter_index' ) ) ; } $ entity -> setNewsletter ( false ) ; $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'success' , 'newsletter.subscripts.disable' ) ; return $ this -> redirect ( $ this -> generateUrl ( 'coreextra_newsletter_subscription' ) ) ; }
docstring: Edits an existing Subscriptors entity.
  
  @param Request $request The request
  @param int     $id      The entity id
  
  @throws NotFoundHttpException
  @return array|RedirectResponse
  
  @Route("/subscription/{id}/disable")
docstring_tokens: Edits an existing Subscriptors entity .