public function getAllVersions()
{
// OPTIMIZE: special iterator that delays loading the versions
if (!$this->versions) {
$rootVersion = $this->getRootVersion();
$results = array($rootVersion->getName() => $rootVersion);
$this->versions = array_merge($results, $this->getEventualSuccessors($rootVersion));
}
return new ArrayIterator($this->versions);
}