DirectorDatafield: fix unset/delete operation
This commit is contained in:
parent
e97f3c946a
commit
c5e0a709ad
|
@ -23,7 +23,6 @@ class DirectorDatafield extends DbObject
|
||||||
|
|
||||||
protected $settings = array();
|
protected $settings = array();
|
||||||
|
|
||||||
|
|
||||||
public function set($key, $value)
|
public function set($key, $value)
|
||||||
{
|
{
|
||||||
if ($this->hasProperty($key)) {
|
if ($this->hasProperty($key)) {
|
||||||
|
@ -51,6 +50,20 @@ class DirectorDatafield extends DbObject
|
||||||
return parent::get($key);
|
return parent::get($key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __unset($key)
|
||||||
|
{
|
||||||
|
if ($this->hasProperty($key)) {
|
||||||
|
return parent::__set($key, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($key, $this->settings)) {
|
||||||
|
unset($this->settings[$key]);
|
||||||
|
$this->hasBeenModified = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function getSettings()
|
public function getSettings()
|
||||||
{
|
{
|
||||||
return $this->settings;
|
return $this->settings;
|
||||||
|
@ -101,7 +114,7 @@ class DirectorDatafield extends DbObject
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($del as $key) {
|
foreach ($del as $key) {
|
||||||
$db->update(
|
$db->delete(
|
||||||
'director_datafield_setting',
|
'director_datafield_setting',
|
||||||
$db->quoteInto($where, $key)
|
$db->quoteInto($where, $key)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue