1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 19:31:02 +01:00
phorge-phorge/src/applications/config/storage/PhabricatorConfigEntry.php

43 lines
1 KiB
PHP
Raw Normal View History

<?php
final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO {
protected $id;
protected $phid;
protected $namespace;
protected $configKey;
protected $value;
protected $isDeleted;
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_SERIALIZATION => array(
'value' => self::SERIALIZATION_JSON,
),
) + parent::getConfiguration();
}
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_CONF);
}
public static function loadConfigEntry($key) {
$config_entry = id(new PhabricatorConfigEntry())
->loadOneWhere(
'configKey = %s AND namespace = %s',
$key,
'default');
if (!$config_entry) {
$config_entry = id(new PhabricatorConfigEntry())
->setConfigKey($key)
->setNamespace('default');
}
return $config_entry;
}
}