3 final class ManiphestTaskParentTransaction
4 extends ManiphestTaskTransactionType
{
6 const TRANSACTIONTYPE
= 'parent';
8 public function generateOldValue($object) {
12 public function shouldHide() {
16 public function applyExternalEffects($object, $value) {
17 $parent_phid = $value;
18 $parent_type = ManiphestTaskDependsOnTaskEdgeType
::EDGECONST
;
19 $task_phid = $object->getPHID();
21 id(new PhabricatorEdgeEditor())
22 ->addEdge($parent_phid, $parent_type, $task_phid)
26 public function validateTransactions($object, array $xactions) {
29 $with_effect = array();
30 foreach ($xactions as $xaction) {
31 $task_phid = $xaction->getNewValue();
36 $with_effect[] = $xaction;
38 $task = id(new ManiphestTaskQuery())
39 ->setViewer($this->getActor())
40 ->withPHIDs(array($task_phid))
43 $errors[] = $this->newInvalidError(
45 'Parent task identifier "%s" does not identify a visible '.
51 if ($with_effect && !$this->isNewObject()) {
52 $errors[] = $this->newInvalidError(
54 'You can only select a parent task when creating a '.
55 'transaction for the first time.'));