[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/diffusion/data/ -> DiffusionRepositoryRef.php (source)

   1  <?php
   2  
   3  /**
   4   * @task serialization Serializing Repository Refs
   5   */
   6  final class DiffusionRepositoryRef extends Phobject {
   7  
   8    private $shortName;
   9    private $commitIdentifier;
  10    private $rawFields = array();
  11  
  12    public function setRawFields(array $raw_fields) {
  13      $this->rawFields = $raw_fields;
  14      return $this;
  15    }
  16  
  17    public function getRawFields() {
  18      return $this->rawFields;
  19    }
  20  
  21    public function setCommitIdentifier($commit_identifier) {
  22      $this->commitIdentifier = $commit_identifier;
  23      return $this;
  24    }
  25  
  26    public function getCommitIdentifier() {
  27      return $this->commitIdentifier;
  28    }
  29  
  30    public function setShortName($short_name) {
  31      $this->shortName = $short_name;
  32      return $this;
  33    }
  34  
  35    public function getShortName() {
  36      return $this->shortName;
  37    }
  38  
  39  
  40  /* -(  Serialization  )------------------------------------------------------ */
  41  
  42  
  43    public function toDictionary() {
  44      return array(
  45        'shortName' => $this->shortName,
  46        'commitIdentifier' => $this->commitIdentifier,
  47        'rawFields' => $this->rawFields,
  48      );
  49    }
  50  
  51    public static function newFromDictionary(array $dict) {
  52      return id(new DiffusionRepositoryRef())
  53        ->setShortName($dict['shortName'])
  54        ->setCommitIdentifier($dict['commitIdentifier'])
  55        ->setRawFields($dict['rawFields']);
  56    }
  57  
  58    public static function loadAllFromDictionaries(array $dictionaries) {
  59      $refs = array();
  60      foreach ($dictionaries as $dictionary) {
  61        $refs[] = self::newFromDictionary($dictionary);
  62      }
  63      return $refs;
  64    }
  65  
  66  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1