/** * AJAX call to get build meta: */ public function meta($buildId) { $build = BuildFactory::getBuildById($buildId); $key = $this->getParam('key', null); $numBuilds = $this->getParam('num_builds', 1); $data = null; if ($key && $build) { $data = $this->buildStore->getMeta($key, $build->getProjectId(), $buildId, $numBuilds); } die(json_encode($data)); }
/** * AJAX call to get build meta: */ public function meta($buildId) { $build = BuildFactory::getBuildById($buildId); $key = $this->getParam('key', null); $numBuilds = $this->getParam('num_builds', 1); $data = null; if ($key && $build) { $data = $this->buildStore->getMeta($key, $build->getProjectId(), $buildId, $build->getBranch(), $numBuilds); } $response = new JsonResponse(); $response->setContent($data); return $response; }
/** * Fetch the summary data of the current build. * * @return array */ private function getBuildSummary() { $build = $this->pluginFactory->getResourceFor('PHPCI\\Model\\Build'); $metas = $this->store->getMeta('plugin-summary', $build->getProjectId(), $build->getId()); return isset($metas[0]['meta_value']) ? $metas[0]['meta_value'] : array(); }