/**
  * Полное сообщение с описанием операции (для email)
  *
  * @param  Operation $operation
  * @return Swift_Message
  */
 private function _makeMessage(Operation $operation)
 {
     $from = array(sfConfig::get('app_notification_email_from') => sfConfig::get('app_notification_email_name'));
     $to = $operation->getUser()->getUserMail();
     $subject = "Easyfinance.ru - напоминание об операции";
     $body = sprintf($this->_template, $operation->getDateTimeObject('date')->format('d.m.y'), $operation->getCategory()->getName(), $operation->getAccount()->getName(), abs($operation->getAmount()), $operation->getAccount()->getCurrency()->getCode(), $operation->getComment());
     return $this->_mailer->compose($from, $to, $subject, $body);
 }
 public function setOperation(Operation $operation)
 {
     $this->_levelValues["parentCategory"] = $operation->getCategory()->getParentCategory();
     $this->_levelValues["category"] = $operation->getCategory();
     $tags = array_map('trim', explode(',', $operation->getTags()));
     $tag = isset($tags[0]) ? $tags[0] : null;
     $this->_levelValues["tag"] = $tag;
     $this->amount = $operation->getAmountForBudget($this->currency, true);
 }
 /**
  * Сообщение вида:
  * ДАТА, СУММА ВАЛЮТА, КАТЕГОРИЯ, СЧЕТ, КОММЕНТАРИЙ
  *
  * @param  Operation $operation
  * @return string
  */
 private function _makeMessage($operation)
 {
     $words = array($operation->getDateTimeObject('date')->format('d.m'), abs($operation->getAmount()) . ' ' . $operation->getAccount()->getCurrency()->getCode(), (string) strip_tags($operation->getCategory()->getName()), (string) strip_tags($operation->getAccount()->getName()), strip_tags($operation->getComment()));
     return $this->_fixMessageLenth($words);
 }