Skip to content

Commit

Permalink
Homepage|Build Repository|Refactor: Represent the event chains in the…
Browse files Browse the repository at this point in the history
… object model

Instead of building a variety of indexes for BuildEvents for each
logical property, we now instead link together these objects to form
navigable event chains.

Each BuildEvent now contains links to other events:

* Prev/next in stream for this Doomsday version
* Prev/next in stream by build start date
  • Loading branch information
danij-deng committed Mar 18, 2012
1 parent ab57b3f commit 142f711
Show file tree
Hide file tree
Showing 2 changed files with 297 additions and 131 deletions.
66 changes: 66 additions & 0 deletions web/plugins/buildrepository/buildevent.class.php
Expand Up @@ -34,6 +34,12 @@ class BuildEvent
private $releaseTypeId;
private $releaseNotesUri = NULL;

// Event chains:
private $prevForStartDate = NULL;
private $nextForStartDate = NULL;
private $prevForVersion = NULL;
private $nextForVersion = NULL;

/// @todo Collections should be private but allow public iteration.
public $packages = array();
public $commits = array();
Expand Down Expand Up @@ -106,6 +112,66 @@ public function addPackage(&$package)
$this->packages[] = $package;
}

public function prevForStartDate()
{
return $this->prevForStartDate;
}

public function setPrevForStartDate(&$event)
{
if(!$event instanceof BuildEvent)
{
$this->prevForStartDate = NULL;
return;
}
$this->prevForStartDate = $event;
}

public function nextForStartDate()
{
return $this->nextForStartDate;
}

public function setNextForStartDate(&$event)
{
if(!$event instanceof BuildEvent)
{
$this->nextForStartDate = NULL;
return;
}
$this->nextForStartDate = $event;
}

public function prevForVersion()
{
return $this->prevForVersion;
}

public function setPrevForVersion(&$event)
{
if(!$event instanceof BuildEvent)
{
$this->prevForVersion = NULL;
return;
}
$this->prevForVersion = $event;
}

public function nextForVersion()
{
return $this->nextForVersion;
}

public function setNextForVersion(&$event)
{
if(!$event instanceof BuildEvent)
{
$this->nextForVersion = NULL;
return;
}
$this->nextForVersion = $event;
}

/**
* Add a new Commit record to this build event.
*
Expand Down

0 comments on commit 142f711

Please sign in to comment.