Browse Source

Refactoring services #885

refactoring
Guillaume 1 year ago
parent
commit
59aaaa08e9
2 changed files with 9 additions and 4 deletions
  1. +6
    -1
      common/logic/BaseManager.php
  2. +3
    -3
      common/logic/Order/Order/OrderManager.php

+ 6
- 1
common/logic/BaseManager.php View File

@@ -10,7 +10,7 @@ class BaseManager

public function __call($method, $args)
{
foreach($this->container->getServices() as $serviceClass) {
foreach($this->getContainer()->getServices() as $serviceClass) {
if(method_exists($serviceClass, $method)) {
return call_user_func_array(
[new $serviceClass, $method],
@@ -26,4 +26,9 @@ class BaseManager
{
$this->container = $container;
}

public function getContainer(): ContainerInterface
{
return $this->container;
}
}

+ 3
- 3
common/logic/Order/Order/OrderManager.php View File

@@ -14,7 +14,7 @@ use common\logic\User\User\User;
use yii\db\Query;

/**
* Solver :
* @see OrderSolver
* @method string getFieldNameAmount($typeTotal = Order::AMOUNT_TOTAL, string $typeField = '')
* @method float getOrderTotalVat(Order $order, string $typeTotal = Order::AMOUNT_TOTAL)
* @method string|null getPaymentStatus(Order $order)
@@ -37,7 +37,7 @@ use yii\db\Query;
* @method bool isOrderBelongsToUser(Order $order, User $user = null)
* @method string getDataJson(Order $order)
*
* Repository :
* @see OrderRepository
* @method array defaultOptionsSearch()
* @method Order|null findOneById(int $id)
* @method array findBy(array $params = [], array $options = [])
@@ -48,7 +48,7 @@ use yii\db\Query;
* @method string getAmountSummary(Order $order)
* @method string getState(Order $order)
*
* Builder :
* @see OrderBuilder
* @method Order instanciateOrder(Distribution $distribution)
* @method Order createOrder(Distribution $distribution)
* @method Order|null createOrderFromSubscription(Subscription $subscription, string $date, bool $force = false)

Loading…
Cancel
Save