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();
}