Differential D21448 Diff 51084 src/applications/repository/storage/PhabricatorRepositoryCommitData.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryCommitData.php
| Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | public function newPublisherHoldReasons() { | ||||
| foreach ($holds as $key => $reason) { | foreach ($holds as $key => $reason) { | ||||
| $holds[$key] = PhabricatorRepositoryPublisherHoldReason::newForHoldKey( | $holds[$key] = PhabricatorRepositoryPublisherHoldReason::newForHoldKey( | ||||
| $reason); | $reason); | ||||
| } | } | ||||
| return array_values($holds); | return array_values($holds); | ||||
| } | } | ||||
| public function setCommitRef(DiffusionCommitRef $ref) { | public function getAuthorString() { | ||||
| $this->setCommitDetail('commitRef', $ref->newDictionary()); | $author = phutil_string_cast($this->authorName); | ||||
| if (strlen($author)) { | |||||
| return $author; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| public function getAuthorDisplayName() { | |||||
| return $this->getCommitDetailString('authorName'); | |||||
| } | |||||
| public function getAuthorEmail() { | |||||
| return $this->getCommitDetailString('authorEmail'); | |||||
| } | |||||
| public function getAuthorEpoch() { | |||||
| $epoch = $this->getCommitDetail('authorEpoch'); | |||||
| if ($epoch) { | |||||
| return (int)$epoch; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| public function getCommitterString() { | |||||
| return $this->getCommitDetailString('committer'); | |||||
| } | |||||
| public function getCommitterDisplayName() { | |||||
| return $this->getCommitDetailString('committerName'); | |||||
| } | |||||
| public function getCommitterEmail() { | |||||
| return $this->getCommitDetailString('committerEmail'); | |||||
| } | |||||
| private function getCommitDetailString($key) { | |||||
| $string = $this->getCommitDetail($key); | |||||
| $string = phutil_string_cast($string); | |||||
| if (strlen($string)) { | |||||
| return $string; | |||||
| } | } | ||||
| public function newCommitRef() { | return null; | ||||
| $map = $this->getCommitDetail('commitRef', array()); | |||||
| return DiffusionCommitRef::neWFromDictionary($map); | |||||
| } | } | ||||
| } | } | ||||