Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialChangeset.php
<?php | <?php | ||||
final class DifferentialChangeset | final class DifferentialChangeset | ||||
extends DifferentialDAO | extends DifferentialDAO | ||||
implements | implements | ||||
PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
PhabricatorDestructibleInterface { | PhabricatorDestructibleInterface, | ||||
PhabricatorConduitResultInterface { | |||||
protected $diffID; | protected $diffID; | ||||
protected $oldFile; | protected $oldFile; | ||||
protected $filename; | protected $filename; | ||||
protected $awayPaths; | protected $awayPaths; | ||||
protected $changeType; | protected $changeType; | ||||
protected $fileType; | protected $fileType; | ||||
protected $metadata = array(); | protected $metadata = array(); | ||||
▲ Show 20 Lines • Show All 714 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
$engine->destroyObject($hunk); | $engine->destroyObject($hunk); | ||||
} | } | ||||
$this->delete(); | $this->delete(); | ||||
$this->saveTransaction(); | $this->saveTransaction(); | ||||
} | } | ||||
/* -( PhabricatorConduitResultInterface )---------------------------------- */ | |||||
public function getFieldSpecificationsForConduit() { | |||||
return array( | |||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('diffPHID') | |||||
->setType('phid') | |||||
->setDescription(pht('The diff the changeset is attached to.')), | |||||
); | |||||
} | |||||
public function getFieldValuesForConduit() { | |||||
$diff = $this->getDiff(); | |||||
$repository = null; | |||||
if ($diff) { | |||||
$revision = $diff->getRevision(); | |||||
if ($revision) { | |||||
$repository = $revision->getRepository(); | |||||
} | |||||
} | |||||
$absolute_path = $this->getAbsoluteRepositoryPath($repository, $diff); | |||||
if (strlen($absolute_path)) { | |||||
$absolute_path = base64_encode($absolute_path); | |||||
} else { | |||||
$absolute_path = null; | |||||
} | |||||
$display_path = $this->getDisplayFilename(); | |||||
return array( | |||||
'diffPHID' => $diff->getPHID(), | |||||
'path' => array( | |||||
'displayPath' => $display_path, | |||||
'absolutePath.base64' => $absolute_path, | |||||
), | |||||
); | |||||
} | |||||
public function getConduitSearchAttachments() { | |||||
return array(); | |||||
} | |||||
} | } |