[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/almanac/storage/ -> AlmanacProperty.php (source)

   1  <?php
   2  
   3  final class AlmanacProperty
   4    extends PhabricatorCustomFieldStorage
   5    implements PhabricatorPolicyInterface {
   6  
   7    protected $fieldName;
   8  
   9    private $object = self::ATTACHABLE;
  10  
  11    public function getApplicationName() {
  12      return 'almanac';
  13    }
  14  
  15    public function getConfiguration() {
  16      $config = parent::getConfiguration();
  17  
  18      $config[self::CONFIG_COLUMN_SCHEMA] += array(
  19        'fieldName' => 'text128',
  20      );
  21  
  22      return $config;
  23    }
  24  
  25    public function getObject() {
  26      return $this->assertAttached($this->object);
  27    }
  28  
  29    public function attachObject(PhabricatorLiskDAO $object) {
  30      $this->object = $object;
  31      return $this;
  32    }
  33  
  34  /* -(  PhabricatorPolicyInterface  )----------------------------------------- */
  35  
  36  
  37    public function getCapabilities() {
  38      return array(
  39        PhabricatorPolicyCapability::CAN_VIEW,
  40        PhabricatorPolicyCapability::CAN_EDIT,
  41      );
  42    }
  43  
  44    public function getPolicy($capability) {
  45      return $this->getObject()->getPolicy($capability);
  46    }
  47  
  48    public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
  49      return $this->getObject()->hasAutomaticCapability($capability, $viewer);
  50    }
  51  
  52    public function describeAutomaticCapability($capability) {
  53      return pht('Properties inherit the policies of their object.');
  54    }
  55  
  56  }


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