浏览代码

Refactoring services #885

refactoring
Guillaume 1年前
父节点
当前提交
59aaaa08e9
共有 2 个文件被更改,包括 9 次插入4 次删除
  1. +6
    -1
      common/logic/BaseManager.php
  2. +3
    -3
      common/logic/Order/Order/OrderManager.php

+ 6
- 1
common/logic/BaseManager.php 查看文件

@@ -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 查看文件

@@ -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)

正在加载...
取消
保存