Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / data / DiffusionCommitHash.php
blobb6eb4c75f41c8493c5e4cea10b4862d2dde762c5
1 <?php
3 final class DiffusionCommitHash extends Phobject {
5 private $hashType;
6 private $hashValue;
8 public function setHashValue($hash_value) {
9 $this->hashValue = $hash_value;
10 return $this;
13 public function getHashValue() {
14 return $this->hashValue;
17 public function setHashType($hash_type) {
18 $this->hashType = $hash_type;
19 return $this;
22 public function getHashType() {
23 return $this->hashType;
26 public static function convertArrayToObjects(array $hashes) {
27 $hash_objects = array();
28 foreach ($hashes as $hash) {
29 $type = $hash[0];
30 $hash = $hash[1];
31 $hash_objects[] = id(new DiffusionCommitHash())
32 ->setHashType($type)
33 ->setHashValue($hash);
35 return $hash_objects;
38 public static function newFromDictionary(array $map) {
39 $hash_type = idx($map, 'type');
40 $hash_value = idx($map, 'value');
42 return id(new self())
43 ->setHashType($hash_type)
44 ->setHashValue($hash_value);
47 public function newDictionary() {
48 return array(
49 'type' => $this->hashType,
50 'value' => $this->hashValue,