fix: Rename Plugin_config methods to avoid conflict with CodeIgniter Model::set()

The PluginConfig class extends CodeIgniter\Model which has its own set() method
for query building. Renaming get()/set() to getValue()/setValue() avoids this conflict.

Also fixed:
- batchSave() to use setValue() instead of set()
- Updated all callers in PluginManager and BasePlugin to use renamed methods
This commit is contained in:
Ollama
2026-03-24 08:07:18 +00:00
parent 896ed87797
commit 0ea3ced674
3 changed files with 12 additions and 12 deletions

View File

@@ -23,7 +23,7 @@ class PluginConfig extends Model
return ($builder->get()->getNumRows() === 1);
}
public function get(string $key): ?string
public function getValue(string $key): ?string
{
$builder = $this->db->table('plugin_config');
$query = $builder->getWhere(['key' => $key], 1);
@@ -35,7 +35,7 @@ class PluginConfig extends Model
return null;
}
public function set(string $key, string $value): bool
public function setValue(string $key, string $value): bool
{
$builder = $this->db->table('plugin_config');
@@ -84,7 +84,7 @@ class PluginConfig extends Model
$this->db->transStart();
foreach ($data as $key => $value) {
$success &= $this->set($key, $value);
$success &= $this->setValue($key, $value);
}
$this->db->transComplete();