/**
  * persist vacation data in db
  */
 protected function _saveVacation()
 {
     if (empty($this->_vacation)) {
         return;
     }
     $vacationRecord = new Felamimail_Model_Sieve_Vacation();
     $vacationRecord->setFromFSV($this->_vacation);
     $vacationRecord->account_id = $this->_accountId;
     $vacationRecord->setId($this->_accountId);
     $vacationRecord->addresses = Zend_Json::encode($vacationRecord->addresses);
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Saving vacation in DB: ' . print_r($vacationRecord->toArray(), TRUE));
     }
     try {
         $oldVac = $this->_vacationBackend->get($vacationRecord->getId());
         $this->_vacationBackend->update($vacationRecord);
     } catch (Tinebase_Exception_NotFound $tenf) {
         $this->_vacationBackend->create($vacationRecord);
     }
 }
 /**
  * get vacation message defined by template / do substitutions for dates and representative
  *
  * @param Felamimail_Model_Sieve_Vacation $vacation
  * @return string
  */
 public function getVacationMessage(Felamimail_Model_Sieve_Vacation $vacation)
 {
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . print_r($vacation->toArray(), TRUE));
     }
     $message = $this->_getMessageFromTemplateFile($vacation->template_id);
     $message = $this->_doMessageSubstitutions($vacation, $message);
     return $message;
 }