WellCommerce\Bundle\DistributionBundle\Manager\PackageManager::changePackageStatus PHP Method

changePackageStatus() public method

Changes package info according to operation and data fetched from PackagistAPI
public changePackageStatus ( Request $request )
$request Symfony\Component\HttpFoundation\Request
    public function changePackageStatus(Request $request)
    {
        /**
         * @var $package \WellCommerce\Bundle\DistributionBundle\Entity\Package
         */
        $id = $request->attributes->get('id');
        $em = $this->getDoctrineHelper()->getEntityManager();
        $repository = $this->getRepository();
        $package = $repository->find($id);
        if (null === $package) {
            throw new EntityNotFoundException($repository->getMetaData()->getName(), $id);
        }
        $this->setPackageVersions($package);
        $em->flush();
    }