add getProjectTitle convenience method to the Build class.

This commit is contained in:
meadsteve 2014-02-25 22:36:20 +00:00
parent 4d5f4b44b7
commit 2b93fe0c94
2 changed files with 10 additions and 1 deletions

View file

@ -27,7 +27,7 @@ class BuildInterpolator
$this->interpolation_vars['%COMMIT%'] = $build->getCommitId();
$this->interpolation_vars['%PROJECT%'] = $build->getProjectId();
$this->interpolation_vars['%BUILD%'] = $build->getId();
$this->interpolation_vars['%PROJECT_TITLE%'] = $build->getProject()->getTitle();
$this->interpolation_vars['%PROJECT_TITLE%'] = $build->getProjectTitle();
$this->interpolation_vars['%BUILD_PATH%'] = $buildPath;
$this->interpolation_vars['%BUILD_URI%'] = $phpCiUrl . "build/view/" . $build->getId();
$this->interpolation_vars['%PHPCI_COMMIT%'] = $this->interpolation_vars['%COMMIT%'];

View file

@ -36,6 +36,15 @@ class Build extends BuildBase
return '#';
}
/**
* @return string
*/
public function getProjectTitle()
{
$project = $this->getProject();
return $project ? $project->getTitle() : "";
}
/**
* Get link to branch from another source (i.e. Github)
*/