~ubuntu-branches/ubuntu/vivid/phabricator/vivid-proposed

« back to all changes in this revision

Viewing changes to phabricator/src/applications/diffusion/data/DiffusionCommitRef.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2015-01-29 00:15:58 UTC
  • mfrom: (0.16.1) (0.15.1) (0.12.2) (2.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20150129001558-na84707j70qqla7z
Tags: 0~git20150129-1
* New snapshot release
* restricted access to local config file (closes: #775479)
* moved local config file to /var/lib/phabricator (closes: #775478)
* switched mysql-server dependency to recommends (closes: #773536)
* use /run instead of /var/run (closes: #775803)
* prevent package reinstall from overwritting local changes (closes: #776288)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
  private $committerEmail;
10
10
  private $hashes = array();
11
11
 
 
12
  public static function newFromConduitResult(array $result) {
 
13
    $ref = id(new DiffusionCommitRef())
 
14
      ->setCommitterEmail(idx($result, 'committerEmail'))
 
15
      ->setCommitterName(idx($result, 'committerName'))
 
16
      ->setAuthorEmail(idx($result, 'authorEmail'))
 
17
      ->setAuthorName(idx($result, 'authorName'))
 
18
      ->setMessage(idx($result, 'message'));
 
19
 
 
20
    $hashes = array();
 
21
    foreach (idx($result, 'hashes', array()) as $hash_result) {
 
22
      $hashes[] = id(new DiffusionCommitHash())
 
23
        ->setHashType(idx($hash_result, 'type'))
 
24
        ->setHashValue(idx($hash_result, 'value'));
 
25
    }
 
26
 
 
27
    $ref->setHashes($hashes);
 
28
 
 
29
    return $ref;
 
30
  }
 
31
 
12
32
  public function setHashes(array $hashes) {
13
33
    $this->hashes = $hashes;
14
34
    return $this;