Pārlūkot izejas kodu

Refactoring services #885

refactoring
Guillaume Bourgeois pirms 1 gada
vecāks
revīzija
bfdbcd99ec
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. +4
    -1
      common/logic/CreditHistory/CreditHistoryBuilder.php

+ 4
- 1
common/logic/CreditHistory/CreditHistoryBuilder.php Parādīt failu

@@ -4,14 +4,17 @@ namespace common\logic\CreditHistory;

use common\logic\BaseService;
use common\logic\BuilderInterface;
use common\services\UserProducer\UserProducerBuilder;

class CreditHistoryBuilder extends BaseService implements BuilderInterface
{
protected CreditHistorySolver $creditHistorySolver;
protected UserProducerBuilder $userProducerBuilder;

public function __construct()
{
$this->creditHistorySolver = $this->loadService(CreditHistorySolver::class);
$this->userProducerBuilder = $this->loadService(UserProducerBuilder::class);
}

public function save(CreditHistoryModel $creditHistory): bool
@@ -26,7 +29,7 @@ class CreditHistoryBuilder extends BaseService implements BuilderInterface
$creditHistory->save();

// Mise à jour du crédit au niveau de UserProducer
\Yii::$app->logic->getUserProducerContainer()->getService()->updateCredit($creditHistory);
$this->userProducerBuilder->updateCredit($creditHistory);

return true;
}

Notiek ielāde…
Atcelt
Saglabāt