Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialViewState.php
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | $this->viewState['changesets'][$path_hash][$key][$changeset_phid] = | ||||
| $properties; | $properties; | ||||
| } | } | ||||
| public function getChangesetProperty( | public function getChangesetProperty( | ||||
| DifferentialChangeset $changeset, | DifferentialChangeset $changeset, | ||||
| $key, | $key, | ||||
| $default = null) { | $default = null) { | ||||
| $path_hash = $this->getChangesetPathHash($changeset); | $entries = $this->getChangesetPropertyEntries( | ||||
| $changeset, | |||||
| $entries = idxv($this->viewState, array('changesets', $path_hash, $key)); | $key); | ||||
| if (!is_array($entries)) { | |||||
| $entries = array(); | |||||
| } | |||||
| $entries = isort($entries, 'epoch'); | $entries = isort($entries, 'epoch'); | ||||
| $entry = last($entries); | $entry = last($entries); | ||||
| if (!is_array($entry)) { | if (!is_array($entry)) { | ||||
| $entry = array(); | $entry = array(); | ||||
| } | } | ||||
| return idx($entry, 'value', $default); | return idx($entry, 'value', $default); | ||||
| } | } | ||||
| public function getChangesetPropertyEntries( | |||||
| DifferentialChangeset $changeset, | |||||
| $key) { | |||||
| $path_hash = $this->getChangesetPathHash($changeset); | |||||
| $entries = idxv($this->viewState, array('changesets', $path_hash, $key)); | |||||
| if (!is_array($entries)) { | |||||
| $entries = array(); | |||||
| } | |||||
| return $entries; | |||||
| } | |||||
| public function getHasModifications() { | public function getHasModifications() { | ||||
| return $this->hasModifications; | return $this->hasModifications; | ||||
| } | } | ||||
| private function getChangesetPathHash(DifferentialChangeset $changeset) { | private function getChangesetPathHash(DifferentialChangeset $changeset) { | ||||
| $path = $changeset->getFilename(); | $path = $changeset->getFilename(); | ||||
| return PhabricatorHash::digestForIndex($path); | return PhabricatorHash::digestForIndex($path); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||