Knp\Bundle\KnpBundlesBundle\Controller\BundleController::changeUsageStatusAction PHP Method

changeUsageStatusAction() public method

public changeUsageStatusAction ( $ownerName, $name )
    public function changeUsageStatusAction($ownerName, $name)
    {
        /* @var $bundle Bundle */
        $bundle = $this->getRepository('Bundle')->findOneBy(array('ownerName' => $ownerName, 'name' => $name));
        if (!$bundle) {
            throw new NotFoundHttpException(sprintf('The bundle "%s/%s" does not exist', $ownerName, $name));
        }
        $url = $this->generateUrl('bundle_show', array('ownerName' => $ownerName, 'name' => $name));
        if (!($developer = $this->get('security.context')->getToken()->getUser())) {
            return $this->redirect($url);
        }
        $this->get('knp_bundles.bundle.manager')->manageBundleRecommendation($bundle, $developer);
        return $this->redirect($url);
    }