[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/phlux/storage/ -> PhluxVariable.php (source)

   1  <?php
   2  
   3  final class PhluxVariable extends PhluxDAO
   4    implements
   5      PhabricatorFlaggableInterface,
   6      PhabricatorPolicyInterface {
   7  
   8    protected $variableKey;
   9    protected $variableValue;
  10    protected $viewPolicy;
  11    protected $editPolicy;
  12  
  13    public function getConfiguration() {
  14      return array(
  15        self::CONFIG_AUX_PHID => true,
  16        self::CONFIG_SERIALIZATION => array(
  17          'variableValue' => self::SERIALIZATION_JSON,
  18        ),
  19        self::CONFIG_COLUMN_SCHEMA => array(
  20          'variableKey' => 'text64',
  21        ),
  22        self::CONFIG_KEY_SCHEMA => array(
  23          'key_key' => array(
  24            'columns' => array('variableKey'),
  25            'unique' => true,
  26          ),
  27        ),
  28      ) + parent::getConfiguration();
  29    }
  30  
  31    public function generatePHID() {
  32      return PhabricatorPHID::generateNewPHID(PhluxVariablePHIDType::TYPECONST);
  33    }
  34  
  35  
  36  /* -(  PhabricatorPolicyInterface  )----------------------------------------- */
  37  
  38  
  39    public function getCapabilities() {
  40      return array(
  41        PhabricatorPolicyCapability::CAN_VIEW,
  42        PhabricatorPolicyCapability::CAN_EDIT,
  43      );
  44    }
  45  
  46    public function getPolicy($capability) {
  47      switch ($capability) {
  48        case PhabricatorPolicyCapability::CAN_VIEW:
  49          return $this->viewPolicy;
  50        case PhabricatorPolicyCapability::CAN_EDIT:
  51          return $this->editPolicy;
  52      }
  53    }
  54  
  55    public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
  56      return false;
  57    }
  58  
  59    public function describeAutomaticCapability($capability) {
  60      return null;
  61    }
  62  
  63  }


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