public function update(array $changes)
{
if (!$this->isEmpty($changes)) {
$value = $changes[$this->name];
if (!is_array($value)) {
$value = array($value);
}
return $this->attribute->update($value);
}
try {
$old = $this->attribute->value();
return $this->attribute->update(array());
} catch (Horde_Kolab_Server_Exception_Novalue $e) {
return array();
}
}
/** * Return the new internal state for this attribute. * * @param array $changes The object data that should be updated. * * @return array The resulting internal state. * * @throws Horde_Kolab_Server_Exception If storing the value failed. */ public function update(array $changes) { $changes = parent::update($changes); if (!empty($changes)) { throw new Horde_Kolab_Server_Exception(sprintf("The value for \"%s\" may not be modified!", $this->_name)); } return $changes; }