Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/data/DiffusionCommitHash.php
Show All 28 Lines | foreach ($hashes as $hash) { | ||||
$type = $hash[0]; | $type = $hash[0]; | ||||
$hash = $hash[1]; | $hash = $hash[1]; | ||||
$hash_objects[] = id(new DiffusionCommitHash()) | $hash_objects[] = id(new DiffusionCommitHash()) | ||||
->setHashType($type) | ->setHashType($type) | ||||
->setHashValue($hash); | ->setHashValue($hash); | ||||
} | } | ||||
return $hash_objects; | return $hash_objects; | ||||
} | } | ||||
public static function newFromDictionary(array $map) { | |||||
$hash_type = idx($map, 'type'); | |||||
$hash_value = idx($map, 'value'); | |||||
return id(new self()) | |||||
->setHashType($hash_type) | |||||
->setHashValue($hash_value); | |||||
} | |||||
public function newDictionary() { | |||||
return array( | |||||
'type' => $this->hashType, | |||||
'value' => $this->hashValue, | |||||
); | |||||
} | |||||
} | } |