Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / nuance / storage / NuanceQueue.php
bloba19f1693b32ad39dad8770a535e4a2914fcd77ea
1 <?php
3 final class NuanceQueue
4 extends NuanceDAO
5 implements
6 PhabricatorPolicyInterface,
7 PhabricatorApplicationTransactionInterface {
9 protected $name;
10 protected $mailKey;
11 protected $viewPolicy;
12 protected $editPolicy;
14 protected function getConfiguration() {
15 return array(
16 self::CONFIG_AUX_PHID => true,
17 self::CONFIG_COLUMN_SCHEMA => array(
18 'name' => 'text255?',
19 'mailKey' => 'bytes20',
21 ) + parent::getConfiguration();
24 public function generatePHID() {
25 return PhabricatorPHID::generateNewPHID(
26 NuanceQueuePHIDType::TYPECONST);
29 public static function initializeNewQueue() {
30 return id(new self())
31 ->setViewPolicy(PhabricatorPolicies::POLICY_USER)
32 ->setEditPolicy(PhabricatorPolicies::POLICY_USER);
35 public function save() {
36 if (!$this->getMailKey()) {
37 $this->setMailKey(Filesystem::readRandomCharacters(20));
39 return parent::save();
42 public function getURI() {
43 return '/nuance/queue/view/'.$this->getID().'/';
46 public function getWorkURI() {
47 return '/nuance/queue/work/'.$this->getID().'/';
51 /* -( PhabricatorPolicyInterface )----------------------------------------- */
54 public function getCapabilities() {
55 return array(
56 PhabricatorPolicyCapability::CAN_VIEW,
57 PhabricatorPolicyCapability::CAN_EDIT,
61 public function getPolicy($capability) {
62 switch ($capability) {
63 case PhabricatorPolicyCapability::CAN_VIEW:
64 return $this->getViewPolicy();
65 case PhabricatorPolicyCapability::CAN_EDIT:
66 return $this->getEditPolicy();
70 public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
71 return false;
75 /* -( PhabricatorApplicationTransactionInterface )------------------------- */
78 public function getApplicationTransactionEditor() {
79 return new NuanceQueueEditor();
82 public function getApplicationTransactionTemplate() {
83 return new NuanceQueueTransaction();