Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / phragment / storage / PhragmentFragmentVersion.php
blob88e501ee299ffb15486a01abf657df951c5a8a01
1 <?php
3 final class PhragmentFragmentVersion extends PhragmentDAO
4 implements PhabricatorPolicyInterface {
6 protected $sequence;
7 protected $fragmentPHID;
8 protected $filePHID;
10 private $fragment = self::ATTACHABLE;
11 private $file = self::ATTACHABLE;
13 protected function getConfiguration() {
14 return array(
15 self::CONFIG_AUX_PHID => true,
16 self::CONFIG_COLUMN_SCHEMA => array(
17 'sequence' => 'uint32',
18 'filePHID' => 'phid?',
20 self::CONFIG_KEY_SCHEMA => array(
21 'key_version' => array(
22 'columns' => array('fragmentPHID', 'sequence'),
23 'unique' => true,
26 ) + parent::getConfiguration();
29 public function generatePHID() {
30 return PhabricatorPHID::generateNewPHID(
31 PhragmentFragmentVersionPHIDType::TYPECONST);
34 public function getURI() {
35 return '/phragment/version/'.$this->getID().'/';
38 public function getFragment() {
39 return $this->assertAttached($this->fragment);
42 public function attachFragment(PhragmentFragment $fragment) {
43 return $this->fragment = $fragment;
46 public function getFile() {
47 return $this->assertAttached($this->file);
50 public function attachFile(PhabricatorFile $file) {
51 return $this->file = $file;
54 public function getCapabilities() {
55 return array(
56 PhabricatorPolicyCapability::CAN_VIEW,
60 public function getPolicy($capability) {
61 return $this->getFragment()->getPolicy($capability);
64 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
65 return $this->getFragment()->hasAutomaticCapability($capability, $viewer);
68 public function describeAutomaticCapability($capability) {
69 return $this->getFragment()->describeAutomaticCapability($capability);