protected function getCustomTransactionOldValue(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhabricatorPasteTransaction::TYPE_CONTENT: return $object->getFilePHID(); case PhabricatorPasteTransaction::TYPE_TITLE: return $object->getTitle(); case PhabricatorPasteTransaction::TYPE_LANGUAGE: return $object->getLanguage(); } }
protected function getCustomTransactionOldValue(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhabricatorMacroTransaction::TYPE_NAME: return $object->getName(); case PhabricatorMacroTransaction::TYPE_DISABLED: return $object->getIsDisabled(); case PhabricatorMacroTransaction::TYPE_FILE: return $object->getFilePHID(); case PhabricatorMacroTransaction::TYPE_AUDIO: return $object->getAudioPHID(); case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR: return $object->getAudioBehavior(); } }
protected function getCustomTransactionNewValue(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction) { switch ($xaction->getTransactionType()) { case PhabricatorPasteTransaction::TYPE_TITLE: case PhabricatorPasteTransaction::TYPE_LANGUAGE: case PhabricatorPasteTransaction::TYPE_STATUS: return $xaction->getNewValue(); case PhabricatorPasteTransaction::TYPE_CONTENT: // If this transaction does not really change the paste content, return // the current file PHID so this transaction no-ops. $new_content = $xaction->getNewValue(); $old_content = $object->getRawContent(); $file_phid = $object->getFilePHID(); if ($new_content === $old_content && $file_phid) { return $file_phid; } $file = self::initializeFileForPaste($this->getActor(), $this->fileName, $xaction->getNewValue()); return $file->getPHID(); } }