3 final class PhabricatorConfigEntry
4 extends PhabricatorConfigEntryDAO
6 PhabricatorApplicationTransactionInterface
,
7 PhabricatorPolicyInterface
{
14 protected function getConfiguration() {
16 self
::CONFIG_AUX_PHID
=> true,
17 self
::CONFIG_SERIALIZATION
=> array(
18 'value' => self
::SERIALIZATION_JSON
,
20 self
::CONFIG_COLUMN_SCHEMA
=> array(
21 'namespace' => 'text64',
22 'configKey' => 'text64',
23 'isDeleted' => 'bool',
25 self
::CONFIG_KEY_SCHEMA
=> array(
27 'columns' => array('namespace', 'configKey'),
31 ) + parent
::getConfiguration();
34 public function generatePHID() {
35 return PhabricatorPHID
::generateNewPHID(
36 PhabricatorConfigConfigPHIDType
::TYPECONST
);
39 public static function loadConfigEntry($key) {
40 $config_entry = id(new PhabricatorConfigEntry())
42 'configKey = %s AND namespace = %s',
47 $config_entry = id(new PhabricatorConfigEntry())
49 ->setNamespace('default')
57 /* -( PhabricatorApplicationTransactionInterface )------------------------- */
60 public function getApplicationTransactionEditor() {
61 return new PhabricatorConfigEditor();
64 public function getApplicationTransactionTemplate() {
65 return new PhabricatorConfigTransaction();
69 /* -( PhabricatorPolicyInterface )----------------------------------------- */
72 public function getCapabilities() {
74 PhabricatorPolicyCapability
::CAN_VIEW
,
75 PhabricatorPolicyCapability
::CAN_EDIT
,
79 public function getPolicy($capability) {
80 return PhabricatorPolicies
::POLICY_ADMIN
;
83 public function hasAutomaticCapability($capability, PhabricatorUser
$viewer) {