3 final class DiffusionRepositoryPath
extends Phobject
{
12 private $lastModifiedCommit;
13 private $lastCommitData;
15 public function setFullPath($full_path) {
16 $this->fullPath
= $full_path;
20 public function getFullPath() {
21 return $this->fullPath
;
24 public function setPath($path) {
29 public function getPath() {
33 public function setHash($hash) {
38 public function getHash() {
42 public function setLastModifiedCommit(
43 PhabricatorRepositoryCommit
$commit) {
44 $this->lastModifiedCommit
= $commit;
48 public function getLastModifiedCommit() {
49 return $this->lastModifiedCommit
;
52 public function setLastCommitData(
53 PhabricatorRepositoryCommitData
$last_commit_data) {
54 $this->lastCommitData
= $last_commit_data;
58 public function getLastCommitData() {
59 return $this->lastCommitData
;
62 public function setFileType($file_type) {
63 $this->fileType
= $file_type;
67 public function getFileType() {
68 return $this->fileType
;
71 public function setFileSize($file_size) {
72 $this->fileSize
= $file_size;
76 public function getFileSize() {
77 return $this->fileSize
;
80 public function setExternalURI($external_uri) {
81 $this->externalURI
= $external_uri;
85 public function getExternalURI() {
86 return $this->externalURI
;
89 public function toDictionary() {
90 $last_modified_commit = $this->getLastModifiedCommit();
91 if ($last_modified_commit) {
92 $last_modified_commit = $last_modified_commit->toDictionary();
94 $last_commit_data = $this->getLastCommitData();
95 if ($last_commit_data) {
96 $last_commit_data = $last_commit_data->toDictionary();
99 'fullPath' => $this->getFullPath(),
100 'path' => $this->getPath(),
101 'hash' => $this->getHash(),
102 'fileType' => $this->getFileType(),
103 'fileSize' => $this->getFileSize(),
104 'externalURI' => $this->getExternalURI(),
105 'lastModifiedCommit' => $last_modified_commit,
106 'lastCommitData' => $last_commit_data,
110 public static function newFromDictionary(array $dict) {
111 $path = id(new DiffusionRepositoryPath())
112 ->setFullPath($dict['fullPath'])
113 ->setPath($dict['path'])
114 ->setHash($dict['hash'])
115 ->setFileType($dict['fileType'])
116 ->setFileSize($dict['fileSize'])
117 ->setExternalURI($dict['externalURI']);
118 if ($dict['lastModifiedCommit']) {
119 $last_modified_commit = PhabricatorRepositoryCommit
::newFromDictionary(
120 $dict['lastModifiedCommit']);
121 $path->setLastModifiedCommit($last_modified_commit);
123 if ($dict['lastCommitData']) {
124 $last_commit_data = PhabricatorRepositoryCommitData
::newFromDictionary(
125 $dict['lastCommitData']);
126 $path->setLastCommitData($last_commit_data);