public function recordNotification(Notification $notification, SettingDecimal $settingSmsExchangeRate) { if (!$notification->getStudent()) { return FALSE; } if (!$notification->getStudent()->getNfcTag()) { return FALSE; } $item = $this->getNotificationMessageItem(); $price = bcmul($notification->getPrice(), $settingSmsExchangeRate->getSettingValue(), 2); $purchaseService = $this->getPurchaseService(); $purchaseService->setStudent($notification->getStudent())->setNfcTag($notification->getStudent()->getNfcTag())->setItem($item)->setPrice($price)->setPurchasedAt(new DateTime()); $this->_manager->persist($purchaseService); }