Allow see project build status in cctray xml format
Refactoring is done for BuildStatus information. - Fixed all phpcs, phpmd errors - Added test for my code (hurray 100 tests already :D) Closed #705
This commit is contained in:
parent
a22390c83d
commit
8fc4c51d54
4 changed files with 514 additions and 3 deletions
|
|
@ -107,6 +107,27 @@ class BuildStore extends BuildStoreBase
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all registered branches for project
|
||||
*
|
||||
* @param $projectId
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getBuildBranches($projectId)
|
||||
{
|
||||
$query = 'SELECT DISTINCT `branch` FROM `build` WHERE `project_id` = :project_id';
|
||||
$stmt = Database::getConnection('read')->prepare($query);
|
||||
$stmt->bindValue(':project_id', $projectId);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
$res = $stmt->fetchAll(\PDO::FETCH_COLUMN);
|
||||
return $res;
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return build metadata by key, project and optionally build id.
|
||||
* @param $key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue