protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhamePostTransaction::TYPE_TITLE: return $object->setTitle($xaction->getNewValue()); case PhamePostTransaction::TYPE_SUBTITLE: return $object->setSubtitle($xaction->getNewValue()); case PhamePostTransaction::TYPE_BODY: return $object->setBody($xaction->getNewValue()); case PhamePostTransaction::TYPE_BLOG: return $object->setBlogPHID($xaction->getNewValue()); case PhamePostTransaction::TYPE_HEADERIMAGE: return $object->setHeaderImagePHID($xaction->getNewValue()); case PhamePostTransaction::TYPE_VISIBILITY: if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) { $object->setDatePublished(0); } else { if ($xaction->getNewValue() == PhameConstants::VISIBILITY_ARCHIVED) { $object->setDatePublished(0); } else { $object->setDatePublished(PhabricatorTime::getNow()); } } return $object->setVisibility($xaction->getNewValue()); } return parent::applyCustomInternalTransaction($object, $xaction); }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case LegalpadTransaction::TYPE_TITLE: $object->setTitle($xaction->getNewValue()); $body = $object->getDocumentBody(); $body->setTitle($xaction->getNewValue()); $this->setIsContribution(true); break; case LegalpadTransaction::TYPE_TEXT: $body = $object->getDocumentBody(); $body->setText($xaction->getNewValue()); $this->setIsContribution(true); break; case LegalpadTransaction::TYPE_SIGNATURE_TYPE: $object->setSignatureType($xaction->getNewValue()); break; case LegalpadTransaction::TYPE_PREAMBLE: $object->setPreamble($xaction->getNewValue()); break; case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE: $object->setRequireSignature((int) $xaction->getNewValue()); break; } }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhamePostTransaction::TYPE_TITLE: return $object->setTitle($xaction->getNewValue()); case PhamePostTransaction::TYPE_PHAME_TITLE: return $object->setPhameTitle($xaction->getNewValue()); case PhamePostTransaction::TYPE_BODY: return $object->setBody($xaction->getNewValue()); case PhamePostTransaction::TYPE_COMMENTS_WIDGET: return $object->setCommentsWidget($xaction->getNewValue()); } return parent::applyCustomInternalTransaction($object, $xaction); }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhabricatorPasteTransaction::TYPE_CONTENT: $object->setFilePHID($xaction->getNewValue()); return; case PhabricatorPasteTransaction::TYPE_TITLE: $object->setTitle($xaction->getNewValue()); return; case PhabricatorPasteTransaction::TYPE_LANGUAGE: $object->setLanguage($xaction->getNewValue()); return; } return parent::applyCustomInternalTransaction($object, $xaction); }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { $type = $xaction->getTransactionType(); switch ($type) { case PhabricatorCountdownTransaction::TYPE_TITLE: $object->setTitle($xaction->getNewValue()); return; case PhabricatorCountdownTransaction::TYPE_DESCRIPTION: $object->setDescription($xaction->getNewValue()); return; case PhabricatorCountdownTransaction::TYPE_EPOCH: $object->setEpoch($xaction->getNewValue()); return; } return parent::applyCustomInternalTransaction($object, $xaction); }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhamePostTransaction::TYPE_TITLE: return $object->setTitle($xaction->getNewValue()); case PhamePostTransaction::TYPE_PHAME_TITLE: return $object->setPhameTitle($xaction->getNewValue()); case PhamePostTransaction::TYPE_BODY: return $object->setBody($xaction->getNewValue()); case PhamePostTransaction::TYPE_VISIBILITY: if ($xaction->getNewValue() == PhameConstants::VISIBILITY_DRAFT) { $object->setDatePublished(0); } else { $object->setDatePublished(PhabricatorTime::getNow()); } return $object->setVisibility($xaction->getNewValue()); } return parent::applyCustomInternalTransaction($object, $xaction); }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case ManiphestTransaction::TYPE_PRIORITY: return $object->setPriority($xaction->getNewValue()); case ManiphestTransaction::TYPE_STATUS: return $object->setStatus($xaction->getNewValue()); case ManiphestTransaction::TYPE_TITLE: return $object->setTitle($xaction->getNewValue()); case ManiphestTransaction::TYPE_DESCRIPTION: return $object->setDescription($xaction->getNewValue()); case ManiphestTransaction::TYPE_OWNER: $phid = $xaction->getNewValue(); // Update the "ownerOrdering" column to contain the full name of the // owner, if the task is assigned. $handle = null; if ($phid) { $handle = id(new PhabricatorHandleQuery())->setViewer($this->getActor())->withPHIDs(array($phid))->executeOne(); } if ($handle) { $object->setOwnerOrdering($handle->getName()); } else { $object->setOwnerOrdering(null); } return $object->setOwnerPHID($phid); case ManiphestTransaction::TYPE_SUBPRIORITY: $object->setSubpriority($xaction->getNewValue()); return; case ManiphestTransaction::TYPE_PROJECT_COLUMN: // these do external (edge) updates return; case ManiphestTransaction::TYPE_MERGED_INTO: $object->setStatus(ManiphestTaskStatus::getDuplicateStatus()); return; case ManiphestTransaction::TYPE_MERGED_FROM: return; } }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { $make_author_recent_participant = true; switch ($xaction->getTransactionType()) { case ConpherenceTransaction::TYPE_TITLE: $object->setTitle($xaction->getNewValue()); break; case ConpherenceTransaction::TYPE_PICTURE: $object->setImagePHID($xaction->getNewValue(), ConpherenceImageData::SIZE_ORIG); break; case ConpherenceTransaction::TYPE_PICTURE_CROP: $object->setImagePHID($xaction->getNewValue(), ConpherenceImageData::SIZE_CROP); break; case ConpherenceTransaction::TYPE_PARTICIPANTS: if (!$this->getIsNewObject()) { $old_map = array_fuse($xaction->getOldValue()); $new_map = array_fuse($xaction->getNewValue()); // if we added people, add them to the end of "recent" participants $add = array_keys(array_diff_key($new_map, $old_map)); // if we remove people, then definintely remove them from "recent" // participants $del = array_keys(array_diff_key($old_map, $new_map)); if ($add || $del) { $participants = $object->getRecentParticipantPHIDs(); if ($add) { $participants = array_merge($participants, $add); } if ($del) { $participants = array_diff($participants, $del); $actor = $this->requireActor(); if (in_array($actor->getPHID(), $del)) { $make_author_recent_participant = false; } } $participants = array_slice(array_unique($participants), 0, 10); $object->setRecentParticipantPHIDs($participants); } } break; } if ($make_author_recent_participant) { $this->makeAuthorMostRecentParticipant($object, $xaction); } }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PonderQuestionTransaction::TYPE_TITLE: $object->setTitle($xaction->getNewValue()); break; case PonderQuestionTransaction::TYPE_CONTENT: $object->setContent($xaction->getNewValue()); break; case PonderQuestionTransaction::TYPE_STATUS: $object->setStatus($xaction->getNewValue()); break; case PonderQuestionTransaction::TYPE_ANSWERS: $old = $xaction->getOldValue(); $new = $xaction->getNewValue(); $add = array_diff_key($new, $old); $rem = array_diff_key($old, $new); $count = $object->getAnswerCount(); $count += count($add); $count -= count($rem); $object->setAnswerCount($count); break; } }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case ManiphestTransaction::TYPE_PRIORITY: return $object->setPriority($xaction->getNewValue()); case ManiphestTransaction::TYPE_STATUS: return $object->setStatus($xaction->getNewValue()); case ManiphestTransaction::TYPE_TITLE: return $object->setTitle($xaction->getNewValue()); case ManiphestTransaction::TYPE_DESCRIPTION: return $object->setDescription($xaction->getNewValue()); case ManiphestTransaction::TYPE_OWNER: $phid = $xaction->getNewValue(); // Update the "ownerOrdering" column to contain the full name of the // owner, if the task is assigned. $handle = null; if ($phid) { $handle = id(new PhabricatorHandleQuery())->setViewer($this->getActor())->withPHIDs(array($phid))->executeOne(); } if ($handle) { $object->setOwnerOrdering($handle->getName()); } else { $object->setOwnerOrdering(null); } return $object->setOwnerPHID($phid); case ManiphestTransaction::TYPE_SUBPRIORITY: $object->setSubpriority($xaction->getNewValue()); return; case ManiphestTransaction::TYPE_MERGED_INTO: $object->setStatus(ManiphestTaskStatus::getDuplicateStatus()); return; case ManiphestTransaction::TYPE_COVER_IMAGE: $file_phid = $xaction->getNewValue(); if ($file_phid) { $file = id(new PhabricatorFileQuery())->setViewer($this->getActor())->withPHIDs(array($file_phid))->executeOne(); } else { $file = null; } if (!$file || !$file->isTransformableImage()) { $object->setProperty('cover.filePHID', null); $object->setProperty('cover.thumbnailPHID', null); return; } $xform_key = PhabricatorFileThumbnailTransform::TRANSFORM_WORKCARD; $xform = PhabricatorFileTransform::getTransformByKey($xform_key)->executeTransform($file); $object->setProperty('cover.filePHID', $file->getPHID()); $object->setProperty('cover.thumbnailPHID', $xform->getPHID()); return; case ManiphestTransaction::TYPE_POINTS: $object->setPoints($xaction->getNewValue()); return; case ManiphestTransaction::TYPE_MERGED_FROM: case ManiphestTransaction::TYPE_PARENT: case PhabricatorTransactions::TYPE_COLUMNS: return; } }
protected function applyCustomInternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhabricatorTransactions::TYPE_COMMENT: $object->setMessageCount((int) $object->getMessageCount() + 1); break; case ConpherenceTransactionType::TYPE_TITLE: $object->setTitle($xaction->getNewValue()); break; } $this->updateRecentParticipantPHIDs($object, $xaction); }