public function setData($gid, $attribute, $value = null)
{
// Store data.
$this->_setData($gid, $attribute, $value);
// Update data cache.
$sig = $this->_sig('data_' . $gid);
try {
if ($data = $this->_cache->get($sig, 0)) {
$data = @unserialize($data);
} else {
$data = array();
}
} catch (Horde_Cache_Exception $e) {
}
if (is_array($attribute)) {
$data = $attribute;
} else {
$data[$attribute] = $value;
}
try {
$this->_cache->set($sig, serialize($data));
} catch (Horde_Cache_Exception $e) {
}
// Update name and list caches.
$name = null;
if (is_array($attribute)) {
if (isset($attribute['name'])) {
$name = $attribute['name'];
}
} elseif ($attribute == 'name') {
$name = $value;
}
if ($name) {
try {
$this->_cache->set($this->_sig('name_' . $gid), $name);
} catch (Horde_Cache_Exception $e) {
}
if (($list = $this->_getListCache()) !== null) {
$list[$gid] = $name;
$this->_setListCache($list);
}
}
}