Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/storage/PhabricatorOwnersPath.php
| <?php | <?php | ||||
| final class PhabricatorOwnersPath extends PhabricatorOwnersDAO { | final class PhabricatorOwnersPath extends PhabricatorOwnersDAO { | ||||
| protected $packageID; | protected $packageID; | ||||
| protected $repositoryPHID; | protected $repositoryPHID; | ||||
| protected $pathIndex; | protected $pathIndex; | ||||
| protected $path; | protected $path; | ||||
| protected $pathDisplay; | |||||
| protected $excluded; | protected $excluded; | ||||
| private $fragments; | private $fragments; | ||||
| private $fragmentCount; | private $fragmentCount; | ||||
| protected function getConfiguration() { | protected function getConfiguration() { | ||||
| return array( | return array( | ||||
| self::CONFIG_TIMESTAMPS => false, | self::CONFIG_TIMESTAMPS => false, | ||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| 'path' => 'text255', | 'path' => 'text', | ||||
| 'pathDisplay' => 'text', | |||||
| 'pathIndex' => 'bytes12', | 'pathIndex' => 'bytes12', | ||||
| 'excluded' => 'bool', | 'excluded' => 'bool', | ||||
| ), | ), | ||||
| self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
| 'key_path' => array( | 'key_path' => array( | ||||
| 'columns' => array('packageID', 'repositoryPHID', 'pathIndex'), | 'columns' => array('packageID', 'repositoryPHID', 'pathIndex'), | ||||
| 'unique' => true, | 'unique' => true, | ||||
| ), | ), | ||||
| ), | ), | ||||
| ) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
| } | } | ||||
| public static function newFromRef(array $ref) { | public static function newFromRef(array $ref) { | ||||
| $path = new PhabricatorOwnersPath(); | $path = new PhabricatorOwnersPath(); | ||||
| $path->repositoryPHID = $ref['repositoryPHID']; | $path->repositoryPHID = $ref['repositoryPHID']; | ||||
| $raw_path = $ref['path']; | $raw_path = $ref['path']; | ||||
| $path->pathIndex = PhabricatorHash::digestForIndex($raw_path); | $path->pathIndex = PhabricatorHash::digestForIndex($raw_path); | ||||
| $path->path = $raw_path; | $path->path = $raw_path; | ||||
| $path->pathDisplay = $raw_path; | |||||
| $path->excluded = $ref['excluded']; | $path->excluded = $ref['excluded']; | ||||
| return $path; | return $path; | ||||
| } | } | ||||
| public function getRef() { | public function getRef() { | ||||
| return array( | return array( | ||||
| ▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines | |||||