/**
* Syncronizes tags from the tagging backend with the task storage backend,
* if necessary.
*
* @param array $tags Tags from the tagging backend.
*/
public function synchronizeTags($tags)
{
if (isset($this->_internaltags)) {
$lower_internaltags = array_map('Horde_String::lower', $this->_internaltags);
$lower_tags = array_map('Horde_String::lower', $tags);
usort($lower_tags, 'strcoll');
if (array_diff($lower_internaltags, $lower_tags)) {
Kronolith::getTagger()->replaceTags($this->uid, $this->_internaltags, $this->_creator, Kronolith_Tagger::TYPE_EVENT);
}
$this->_tags = $this->_internaltags;
} else {
$this->_tags = $tags;
}
}