You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
506B

  1. <?php
  2. namespace common\logic\User\UserProducer\Event;
  3. use common\logic\User\UserProducer\Wrapper\UserProducerManager;
  4. use justcoded\yii2\eventlistener\observers\ActiveRecordObserver;
  5. use yii\db\AfterSaveEvent;
  6. class CreditHistoryObserver extends ActiveRecordObserver
  7. {
  8. public function inserted(AfterSaveEvent $event)
  9. {
  10. $creditHistory = $event->sender;
  11. $userProducerManager = UserProducerManager::getInstance();
  12. $userProducerManager->updateCredit($creditHistory);
  13. }
  14. }