Differential D17439 Diff 41936 src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
Show All 10 Lines | final class PhabricatorEditEngineConfiguration | ||||
protected $name; | protected $name; | ||||
protected $viewPolicy; | protected $viewPolicy; | ||||
protected $properties = array(); | protected $properties = array(); | ||||
protected $isDisabled = 0; | protected $isDisabled = 0; | ||||
protected $isDefault = 0; | protected $isDefault = 0; | ||||
protected $isEdit = 0; | protected $isEdit = 0; | ||||
protected $createOrder = 0; | protected $createOrder = 0; | ||||
protected $editOrder = 0; | protected $editOrder = 0; | ||||
protected $subtype; | |||||
private $engine = self::ATTACHABLE; | private $engine = self::ATTACHABLE; | ||||
const LOCK_VISIBLE = 'visible'; | const LOCK_VISIBLE = 'visible'; | ||||
const LOCK_LOCKED = 'locked'; | const LOCK_LOCKED = 'locked'; | ||||
const LOCK_HIDDEN = 'hidden'; | const LOCK_HIDDEN = 'hidden'; | ||||
public function getTableName() { | public function getTableName() { | ||||
return 'search_editengineconfiguration'; | return 'search_editengineconfiguration'; | ||||
} | } | ||||
public static function initializeNewConfiguration( | public static function initializeNewConfiguration( | ||||
PhabricatorUser $actor, | PhabricatorUser $actor, | ||||
PhabricatorEditEngine $engine) { | PhabricatorEditEngine $engine) { | ||||
return id(new PhabricatorEditEngineConfiguration()) | return id(new PhabricatorEditEngineConfiguration()) | ||||
->setSubtype(PhabricatorEditEngine::SUBTYPE_DEFAULT) | |||||
->setEngineKey($engine->getEngineKey()) | ->setEngineKey($engine->getEngineKey()) | ||||
->attachEngine($engine) | ->attachEngine($engine) | ||||
->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy()); | ->setViewPolicy(PhabricatorPolicies::getMostOpenPolicy()); | ||||
} | } | ||||
public function generatePHID() { | public function generatePHID() { | ||||
return PhabricatorPHID::generateNewPHID( | return PhabricatorPHID::generateNewPHID( | ||||
PhabricatorEditEngineConfigurationPHIDType::TYPECONST); | PhabricatorEditEngineConfigurationPHIDType::TYPECONST); | ||||
Show All 36 Lines | return array( | ||||
'engineKey' => 'text64', | 'engineKey' => 'text64', | ||||
'builtinKey' => 'text64?', | 'builtinKey' => 'text64?', | ||||
'name' => 'text255', | 'name' => 'text255', | ||||
'isDisabled' => 'bool', | 'isDisabled' => 'bool', | ||||
'isDefault' => 'bool', | 'isDefault' => 'bool', | ||||
'isEdit' => 'bool', | 'isEdit' => 'bool', | ||||
'createOrder' => 'uint32', | 'createOrder' => 'uint32', | ||||
'editOrder' => 'uint32', | 'editOrder' => 'uint32', | ||||
'subtype' => 'text64', | |||||
), | ), | ||||
self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
'key_engine' => array( | 'key_engine' => array( | ||||
'columns' => array('engineKey', 'builtinKey'), | 'columns' => array('engineKey', 'builtinKey'), | ||||
'unique' => true, | 'unique' => true, | ||||
), | ), | ||||
'key_default' => array( | 'key_default' => array( | ||||
'columns' => array('engineKey', 'isDefault', 'isDisabled'), | 'columns' => array('engineKey', 'isDefault', 'isDisabled'), | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |