本文整理匯總了PHP中Operation::getCategory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Operation::getCategory方法的具體用法?PHP Operation::getCategory怎麽用?PHP Operation::getCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Operation
的用法示例。
在下文中一共展示了Operation::getCategory方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _makeMessage
/**
* Полное сообщение с описанием операции (для 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);
}
示例2: setOperation
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);
}
示例3: _makeMessage
/**
* Сообщение вида:
* ДАТА, СУММА ВАЛЮТА, КАТЕГОРИЯ, СЧЕТ, КОММЕНТАРИЙ
*
* @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);
}