Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialChangeset.php
| Show All 19 Lines | final class DifferentialChangeset | ||||
| private $unsavedHunks = array(); | private $unsavedHunks = array(); | ||||
| private $hunks = self::ATTACHABLE; | private $hunks = self::ATTACHABLE; | ||||
| private $diff = self::ATTACHABLE; | private $diff = self::ATTACHABLE; | ||||
| private $authorityPackages; | private $authorityPackages; | ||||
| private $changesetPackages; | private $changesetPackages; | ||||
| private $newFileObject = self::ATTACHABLE; | |||||
| private $oldFileObject = self::ATTACHABLE; | |||||
| const TABLE_CACHE = 'differential_changeset_parse_cache'; | const TABLE_CACHE = 'differential_changeset_parse_cache'; | ||||
| const METADATA_TRUSTED_ATTRIBUTES = 'attributes.trusted'; | const METADATA_TRUSTED_ATTRIBUTES = 'attributes.trusted'; | ||||
| const METADATA_UNTRUSTED_ATTRIBUTES = 'attributes.untrusted'; | const METADATA_UNTRUSTED_ATTRIBUTES = 'attributes.untrusted'; | ||||
| const METADATA_EFFECT_HASH = 'hash.effect'; | const METADATA_EFFECT_HASH = 'hash.effect'; | ||||
| const ATTRIBUTE_GENERATED = 'generated'; | const ATTRIBUTE_GENERATED = 'generated'; | ||||
| ▲ Show 20 Lines • Show All 418 Lines • ▼ Show 20 Lines | public function getChangesetAttribute($key, $default = null) { | ||||
| $map = $this->getChangesetAttributes(); | $map = $this->getChangesetAttributes(); | ||||
| return idx($map, $key, $default); | return idx($map, $key, $default); | ||||
| } | } | ||||
| public function isGeneratedChangeset() { | public function isGeneratedChangeset() { | ||||
| return $this->getChangesetAttribute(self::ATTRIBUTE_GENERATED); | return $this->getChangesetAttribute(self::ATTRIBUTE_GENERATED); | ||||
| } | } | ||||
| public function getNewFileObjectPHID() { | |||||
| $metadata = $this->getMetadata(); | |||||
| return idx($metadata, 'new:binary-phid'); | |||||
| } | |||||
| public function getOldFileObjectPHID() { | |||||
| $metadata = $this->getMetadata(); | |||||
| return idx($metadata, 'old:binary-phid'); | |||||
| } | |||||
| public function attachNewFileObject(PhabricatorFile $file) { | |||||
| $this->newFileObject = $file; | |||||
| return $this; | |||||
| } | |||||
| public function getNewFileObject() { | |||||
| return $this->assertAttached($this->newFileObject); | |||||
| } | |||||
| public function attachOldFileObject(PhabricatorFile $file) { | |||||
| $this->oldFileObject = $file; | |||||
| return $this; | |||||
| } | |||||
| public function getOldFileObject() { | |||||
| return $this->assertAttached($this->oldFileObject); | |||||
| } | |||||
| /* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getCapabilities() { | public function getCapabilities() { | ||||
| return array( | return array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| ); | ); | ||||
| Show All 32 Lines | |||||