function pre_updateInDB()
{
// Clean end alert if begin_date is after old one
// Or if duration is greater than old one
if (isset($this->oldvalues['begin_date']) && $this->oldvalues['begin_date'] < $this->fields['begin_date'] || isset($this->oldvalues['duration']) && $this->oldvalues['duration'] < $this->fields['duration']) {
$alert = new Alert();
$alert->clear($this->getType(), $this->fields['id'], Alert::END);
}
// Clean notice alert if begin_date is after old one
// Or if duration is greater than old one
// Or if notice is lesser than old one
if (isset($this->oldvalues['begin_date']) && $this->oldvalues['begin_date'] < $this->fields['begin_date'] || isset($this->oldvalues['duration']) && $this->oldvalues['duration'] < $this->fields['duration'] || isset($this->oldvalues['notice']) && $this->oldvalues['notice'] > $this->fields['notice']) {
$alert = new Alert();
$alert->clear($this->getType(), $this->fields['id'], Alert::NOTICE);
}
}