blob: 1045e90f0dfbe33c40b34bbd3e27457e1c5be62d [file] [log] [blame]
<?php
/*
* Project Info Object
*
* This class is an abstraction of projec-info.class, it makes this type of object the capability of be serialized
*
* @author: mparra@openmex.com
*
*/
require_once ("persistent.class.php");
require_once ("project-info.class.php");
require_once ("release.class.php");
class ProjectInfoObject extends persistent{
var $project_name = "";
var $root_path = "";
var $releases = array();
var $num_releases = 0;
var $summary = "";
var $summary_timestamp = "";
var $project_timestamp = "";
var $releases_timestamp = "";
function ProjectInfoObject($filename, $projectkey) {
global $projectinfo;
$projectinfo = new ProjectInfo($projectkey,1);
$this->root_path = "";
$projectnamearray = explode(".", $projectkey);
if($projectnamearray[1] == NULL || $projectnamearray[1] == ""){
$this->project_name = $projectnamearray[0];
} else {
$this->root_path = $projectnamearray[0];
$this->project_name = $projectnamearray[1];
}
#Get the releases that should had changed (planned, tentative, scheduled)
$this->num_releases = $projectinfo->hasReleases();
$i = 0;
$num_releases_temp = $this->num_releases;
while($num_releases_temp > 0){
$this->releases[] = $projectinfo->getRelease($num_releases_temp-1);
$num_releases_temp = $num_releases_temp-1;
}
#Get the summary paragraph
$this->summary = $projectinfo->summary_paragraph();
#Get timestamps
$this->summary_timestamp = $projectinfo->gettimestamp("summary_paragraph");
$this->project_timestamp = $projectinfo->gettimestamp("project-info");
$this->releases_timestamp = $projectinfo->gettimestamp("releases");
#Set File name for the temporal object
$this->filename = $filename;
}
function getSummary(){
return $this->summary;
}
function getRelease($index){
return $this->releases[$index];
}
function getNumReleases(){
return $this->num_releases;
}
function getName(){
return $this->project_name;
}
function getSummaryTimestamp(){
return $this->summary_timestamp;
}
function getProjectTimestamp(){
return $this->project_timestamp;
}
function getReleasesTimestamp(){
return $this->releases_timestamp;
}
function getRootPath(){
return $this->root_path;
}
}
?>