/** * When updated, make sure to see whether to create a new version */ public function update() { $parent = $this->projectService->getProject($this->projectid); $otherParent = null; // load the current state $current = $this->dbService->getById($this->id, 'Feature'); if ($current->projectid != $this->projectid) { $otherParent = $this->projectService->getProject($current->projectid); } // $mostRecent = $this->versioningService->getMostRecentVersion($this); if ($this->isChanged(array('estimated', 'title', 'description', 'milestone', 'projectid'), $current)) { if ($otherParent) { $this->versioningService->createVersion($otherParent, 'featureupdate'); } if ($parent) { $this->versioningService->createVersion($parent, 'featureupdate'); } $this->versioningService->createVersion($current); } }
public function created() { $this->versioningService->createVersion($this); }
/** * Create a version when this project is created */ public function created() { if (!$this->ismilestone) { $this->createDefaultMilestone(); } $this->versioningService->createVersion($this); }