[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

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

   1  <?php
   2  
   3  final class DiffusionFileContent {
   4  
   5    private $corpus;
   6    private $blameDict;
   7    private $revList;
   8    private $textList;
   9  
  10    public function setTextList(array $text_list) {
  11      $this->textList = $text_list;
  12      return $this;
  13    }
  14    public function getTextList() {
  15      if (!$this->textList) {
  16        return phutil_split_lines($this->getCorpus(), $retain_ends = false);
  17      }
  18      return $this->textList;
  19    }
  20  
  21    public function setRevList(array $rev_list) {
  22      $this->revList = $rev_list;
  23      return $this;
  24    }
  25    public function getRevList() {
  26      return $this->revList;
  27    }
  28  
  29    public function setBlameDict(array $blame_dict) {
  30      $this->blameDict = $blame_dict;
  31      return $this;
  32    }
  33    public function getBlameDict() {
  34      return $this->blameDict;
  35    }
  36  
  37    public function setCorpus($corpus) {
  38      $this->corpus = $corpus;
  39      return $this;
  40    }
  41  
  42    public function getCorpus() {
  43      return $this->corpus;
  44    }
  45  
  46    public function toDictionary() {
  47      return array(
  48        'corpus' => $this->getCorpus(),
  49        'blameDict' => $this->getBlameDict(),
  50        'revList' => $this->getRevList(),
  51        'textList' => $this->getTextList(),
  52      );
  53    }
  54  
  55    public static function newFromConduit(array $dict) {
  56      return id(new DiffusionFileContent())
  57        ->setCorpus($dict['corpus'])
  58        ->setBlameDict($dict['blameDict'])
  59        ->setRevList($dict['revList'])
  60        ->setTextList($dict['textList']);
  61    }
  62  
  63  }


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