Path: blob/master/src/applications/diffusion/data/DiffusionRepositoryPath.php
12241 views
<?php12final class DiffusionRepositoryPath extends Phobject {34private $fullPath;5private $path;6private $hash;7private $fileType;8private $fileSize;9private $externalURI;1011private $lastModifiedCommit;12private $lastCommitData;1314public function setFullPath($full_path) {15$this->fullPath = $full_path;16return $this;17}1819public function getFullPath() {20return $this->fullPath;21}2223public function setPath($path) {24$this->path = $path;25return $this;26}2728public function getPath() {29return $this->path;30}3132public function setHash($hash) {33$this->hash = $hash;34return $this;35}3637public function getHash() {38return $this->hash;39}4041public function setLastModifiedCommit(42PhabricatorRepositoryCommit $commit) {43$this->lastModifiedCommit = $commit;44return $this;45}4647public function getLastModifiedCommit() {48return $this->lastModifiedCommit;49}5051public function setLastCommitData(52PhabricatorRepositoryCommitData $last_commit_data) {53$this->lastCommitData = $last_commit_data;54return $this;55}5657public function getLastCommitData() {58return $this->lastCommitData;59}6061public function setFileType($file_type) {62$this->fileType = $file_type;63return $this;64}6566public function getFileType() {67return $this->fileType;68}6970public function setFileSize($file_size) {71$this->fileSize = $file_size;72return $this;73}7475public function getFileSize() {76return $this->fileSize;77}7879public function setExternalURI($external_uri) {80$this->externalURI = $external_uri;81return $this;82}8384public function getExternalURI() {85return $this->externalURI;86}8788public function toDictionary() {89$last_modified_commit = $this->getLastModifiedCommit();90if ($last_modified_commit) {91$last_modified_commit = $last_modified_commit->toDictionary();92}93$last_commit_data = $this->getLastCommitData();94if ($last_commit_data) {95$last_commit_data = $last_commit_data->toDictionary();96}97return array(98'fullPath' => $this->getFullPath(),99'path' => $this->getPath(),100'hash' => $this->getHash(),101'fileType' => $this->getFileType(),102'fileSize' => $this->getFileSize(),103'externalURI' => $this->getExternalURI(),104'lastModifiedCommit' => $last_modified_commit,105'lastCommitData' => $last_commit_data,106);107}108109public static function newFromDictionary(array $dict) {110$path = id(new DiffusionRepositoryPath())111->setFullPath($dict['fullPath'])112->setPath($dict['path'])113->setHash($dict['hash'])114->setFileType($dict['fileType'])115->setFileSize($dict['fileSize'])116->setExternalURI($dict['externalURI']);117if ($dict['lastModifiedCommit']) {118$last_modified_commit = PhabricatorRepositoryCommit::newFromDictionary(119$dict['lastModifiedCommit']);120$path->setLastModifiedCommit($last_modified_commit);121}122if ($dict['lastCommitData']) {123$last_commit_data = PhabricatorRepositoryCommitData::newFromDictionary(124$dict['lastCommitData']);125$path->setLastCommitData($last_commit_data);126}127return $path;128}129}130131132