/** * Should we move this method outside of changeset creation * so that we can remove the dependency on artifact factory * and enforce SRP ? */ protected function saveArtifactAfterNewChangeset(Tracker_Artifact $artifact, array $fields_data, PFUser $submitter, Tracker_Artifact_Changeset $new_changeset, Tracker_Artifact_Changeset $previous_changeset = null) { if ($this->artifact_factory->save($artifact)) { $used_fields = $this->formelement_factory->getUsedFields($artifact->getTracker()); foreach ($used_fields as $field) { $field->postSaveNewChangeset($artifact, $submitter, $new_changeset, $previous_changeset); } $artifact->getWorkflow()->after($fields_data, $new_changeset, $previous_changeset); return true; } return false; }