Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/storage/ManiphestTask.php
Show All 24 Lines | final class ManiphestTask extends ManiphestDAO | ||||
protected $description = ''; | protected $description = ''; | ||||
protected $originalEmailSource; | protected $originalEmailSource; | ||||
protected $mailKey; | protected $mailKey; | ||||
protected $viewPolicy = PhabricatorPolicies::POLICY_USER; | protected $viewPolicy = PhabricatorPolicies::POLICY_USER; | ||||
protected $editPolicy = PhabricatorPolicies::POLICY_USER; | protected $editPolicy = PhabricatorPolicies::POLICY_USER; | ||||
protected $attached = array(); | protected $attached = array(); | ||||
protected $projectPHIDs = array(); | protected $projectPHIDs = array(); | ||||
private $projectsNeedUpdate; | |||||
private $subscribersNeedUpdate; | private $subscribersNeedUpdate; | ||||
protected $ownerOrdering; | protected $ownerOrdering; | ||||
private $groupByProjectPHID = self::ATTACHABLE; | private $groupByProjectPHID = self::ATTACHABLE; | ||||
private $customFields = self::ATTACHABLE; | private $customFields = self::ATTACHABLE; | ||||
public static function initializeNewTask(PhabricatorUser $actor) { | public static function initializeNewTask(PhabricatorUser $actor) { | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | final class ManiphestTask extends ManiphestDAO | ||||
} | } | ||||
public function getCCPHIDs() { | public function getCCPHIDs() { | ||||
return array_values(nonempty($this->ccPHIDs, array())); | return array_values(nonempty($this->ccPHIDs, array())); | ||||
} | } | ||||
public function setProjectPHIDs(array $phids) { | public function setProjectPHIDs(array $phids) { | ||||
$this->projectPHIDs = array_values($phids); | $this->projectPHIDs = array_values($phids); | ||||
$this->projectsNeedUpdate = true; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function getProjectPHIDs() { | public function getProjectPHIDs() { | ||||
return array_values(nonempty($this->projectPHIDs, array())); | return array_values(nonempty($this->projectPHIDs, array())); | ||||
} | } | ||||
public function setCCPHIDs(array $phids) { | public function setCCPHIDs(array $phids) { | ||||
Show All 31 Lines | final class ManiphestTask extends ManiphestDAO | ||||
public function save() { | public function save() { | ||||
if (!$this->mailKey) { | if (!$this->mailKey) { | ||||
$this->mailKey = Filesystem::readRandomCharacters(20); | $this->mailKey = Filesystem::readRandomCharacters(20); | ||||
} | } | ||||
$result = parent::save(); | $result = parent::save(); | ||||
if ($this->projectsNeedUpdate) { | |||||
// If we've changed the project PHIDs for this task, update the link | |||||
// table. | |||||
ManiphestTaskProject::updateTaskProjects($this); | |||||
$this->projectsNeedUpdate = false; | |||||
} | |||||
if ($this->subscribersNeedUpdate) { | if ($this->subscribersNeedUpdate) { | ||||
// If we've changed the subscriber PHIDs for this task, update the link | // If we've changed the subscriber PHIDs for this task, update the link | ||||
// table. | // table. | ||||
ManiphestTaskSubscriber::updateTaskSubscribers($this); | ManiphestTaskSubscriber::updateTaskSubscribers($this); | ||||
$this->subscribersNeedUpdate = false; | $this->subscribersNeedUpdate = false; | ||||
} | } | ||||
return $result; | return $result; | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |