Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialDiff.php
| <?php | <?php | ||||
| final class DifferentialDiff | final class DifferentialDiff | ||||
| extends DifferentialDAO | extends DifferentialDAO | ||||
| implements PhabricatorPolicyInterface { | implements | ||||
| PhabricatorPolicyInterface, | |||||
| HarbormasterBuildableInterface { | |||||
| protected $revisionID; | protected $revisionID; | ||||
| protected $authorPHID; | protected $authorPHID; | ||||
| protected $sourceMachine; | protected $sourceMachine; | ||||
| protected $sourcePath; | protected $sourcePath; | ||||
| protected $sourceControlSystem; | protected $sourceControlSystem; | ||||
| ▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function describeAutomaticCapability($capability) { | public function describeAutomaticCapability($capability) { | ||||
| if ($this->getRevision()) { | if ($this->getRevision()) { | ||||
| return pht( | return pht( | ||||
| 'This diff is attached to a revision, and inherits its policies.'); | 'This diff is attached to a revision, and inherits its policies.'); | ||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| /* -( HarbormasterBuildableInterface )------------------------------------- */ | |||||
| public function getHarbormasterBuildablePHID() { | |||||
| return $this->getPHID(); | |||||
| } | |||||
| public function getHarbormasterContainerPHID() { | |||||
| if ($this->getRevisionID()) { | |||||
| $revision = id(new DifferentialRevision())->load($this->getRevisionID()); | |||||
| if ($revision) { | |||||
| return $revision->getPHID(); | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | } | ||||