protected function getCustomTransactionOldValue(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PonderAnswerTransaction::TYPE_CONTENT: return $object->getContent(); } }
protected function getCustomTransactionOldValue(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PonderQuestionTransaction::TYPE_TITLE: return $object->getTitle(); case PonderQuestionTransaction::TYPE_CONTENT: return $object->getContent(); case PonderQuestionTransaction::TYPE_ANSWERS: return mpull($object->getAnswers(), 'getPHID'); case PonderQuestionTransaction::TYPE_STATUS: return $object->getStatus(); } }
private function validateContentVersion(PhabricatorLiskDAO $object, $type, PhabricatorApplicationTransaction $xaction) { $error = null; if ($this->getContentVersion() && $object->getContent()->getVersion() != $this->getContentVersion()) { $error = new PhabricatorApplicationTransactionValidationError($type, pht('Edit Conflict'), pht('Another user made changes to this document after you began ' . 'editing it. Do you want to overwrite their changes? ' . '(If you choose to overwrite their changes, you should review ' . 'the document edit history to see what you overwrote, and ' . 'then make another edit to merge the changes if necessary.)'), $xaction); } return $error; }