Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/storage/PhabricatorOwnersPackage.php
| Show All 10 Lines | implements | ||||
| PhabricatorFulltextInterface, | PhabricatorFulltextInterface, | ||||
| PhabricatorFerretInterface, | PhabricatorFerretInterface, | ||||
| PhabricatorNgramsInterface { | PhabricatorNgramsInterface { | ||||
| protected $name; | protected $name; | ||||
| protected $auditingEnabled; | protected $auditingEnabled; | ||||
| protected $autoReview; | protected $autoReview; | ||||
| protected $description; | protected $description; | ||||
| protected $mailKey; | |||||
| protected $status; | protected $status; | ||||
| protected $viewPolicy; | protected $viewPolicy; | ||||
| protected $editPolicy; | protected $editPolicy; | ||||
| protected $dominion; | protected $dominion; | ||||
| private $paths = self::ATTACHABLE; | private $paths = self::ATTACHABLE; | ||||
| private $owners = self::ATTACHABLE; | private $owners = self::ATTACHABLE; | ||||
| private $customFields = self::ATTACHABLE; | private $customFields = self::ATTACHABLE; | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | protected function getConfiguration() { | ||||
| return array( | return array( | ||||
| // This information is better available from the history table. | // This information is better available from the history table. | ||||
| self::CONFIG_TIMESTAMPS => false, | self::CONFIG_TIMESTAMPS => false, | ||||
| self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| 'name' => 'sort', | 'name' => 'sort', | ||||
| 'description' => 'text', | 'description' => 'text', | ||||
| 'auditingEnabled' => 'bool', | 'auditingEnabled' => 'bool', | ||||
| 'mailKey' => 'bytes20', | |||||
| 'status' => 'text32', | 'status' => 'text32', | ||||
| 'autoReview' => 'text32', | 'autoReview' => 'text32', | ||||
| 'dominion' => 'text32', | 'dominion' => 'text32', | ||||
| ), | ), | ||||
| ) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
| } | } | ||||
| public function generatePHID() { | public function getPHIDType() { | ||||
| return PhabricatorPHID::generateNewPHID( | return PhabricatorOwnersPackagePHIDType::TYPECONST; | ||||
| PhabricatorOwnersPackagePHIDType::TYPECONST); | |||||
| } | |||||
| public function save() { | |||||
| if (!$this->getMailKey()) { | |||||
| $this->setMailKey(Filesystem::readRandomCharacters(20)); | |||||
| } | |||||
| return parent::save(); | |||||
| } | } | ||||
| public function isArchived() { | public function isArchived() { | ||||
| return ($this->getStatus() == self::STATUS_ARCHIVED); | return ($this->getStatus() == self::STATUS_ARCHIVED); | ||||
| } | } | ||||
| public function getMustMatchUngeneratedPaths() { | public function getMustMatchUngeneratedPaths() { | ||||
| // TODO: For now, there's no way to actually configure this. | // TODO: For now, there's no way to actually configure this. | ||||
| ▲ Show 20 Lines • Show All 640 Lines • Show Last 20 Lines | |||||