mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-02 06:14:51 -04:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user