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



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

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

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

use yii\db\Query; use yii\db\Query;


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

Loading…
Cancel
Save