DirectorDatafield: fix unset/delete operation

This commit is contained in:
Thomas Gelf 2015-07-31 16:00:04 +02:00
parent e97f3c946a
commit c5e0a709ad
1 changed files with 15 additions and 2 deletions

View File

@ -23,7 +23,6 @@ class DirectorDatafield extends DbObject
protected $settings = array();
public function set($key, $value)
{
if ($this->hasProperty($key)) {
@ -51,6 +50,20 @@ class DirectorDatafield extends DbObject
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()
{
return $this->settings;
@ -101,7 +114,7 @@ class DirectorDatafield extends DbObject
}
foreach ($del as $key) {
$db->update(
$db->delete(
'director_datafield_setting',
$db->quoteInto($where, $key)
);