public function bundlesAction($name)
{
/* @var $organization Organization */
if (!($organization = $this->getRepository('Organization')->findOneByName($name))) {
return new JsonResponse(array('status' => 'error', 'message' => 'Organization not found.'), 404);
}
$result = array('organization' => $organization->getName(), 'bundles' => array());
/* @var $bundle Bundle */
foreach ($organization->getBundles() as $bundle) {
$result['bundles'][] = array('name' => $bundle->getFullName(), 'state' => $bundle->getState(), 'score' => $bundle->getScore(), 'url' => $this->generateUrl('bundle_show', array('ownerName' => $bundle->getOwnerName(), 'name' => $bundle->getName()), true));
}
return new JsonResponse($result);
}