Exemplo n.º 1
0
 public function build()
 {
     $artifact = new Tracker_Artifact($this->id, $this->tracker_id, $this->submitted_by, $this->submitted_on, null);
     if ($this->tracker) {
         $artifact->setTracker($this->tracker);
     }
     if ($this->formElementFactory) {
         $artifact->setFormElementFactory($this->formElementFactory);
     }
     if ($this->changesets) {
         $artifact->setChangesets($this->changesets);
     }
     if ($this->hierarchy_factory) {
         $artifact->setHierarchyFactory($this->hierarchy_factory);
     }
     if (isset($this->ancestors)) {
         $artifact->setAllAncestors($this->ancestors);
     }
     if ($this->title) {
         $artifact->setTitle($this->title);
     }
     if ($this->parent_without_permission_checking) {
         $artifact->setParentWithoutPermissionChecking($this->parent_without_permission_checking);
     }
     if ($this->submitted_by_user) {
         $artifact->setSubmittedByUser($this->submitted_by_user);
     }
     foreach ($this->user_can_view as $user) {
         $artifact->setUserCanView($user, true);
     }
     return $artifact;
 }