Exemplo n.º 1
0
 /**
  * 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);
     }
 }
Exemplo n.º 2
0
 public function created()
 {
     $this->versioningService->createVersion($this);
 }
Exemplo n.º 3
0
 /**
  * Create a version when this project is created
  */
 public function created()
 {
     if (!$this->ismilestone) {
         $this->createDefaultMilestone();
     }
     $this->versioningService->createVersion($this);
 }