@@ -29,7 +29,7 @@ use yii\base\ErrorException; | |||
class BusinessLogic | |||
{ | |||
use BusinessLogicContainerTrait; | |||
use BusinessLogicTrait; | |||
public function getContainers() | |||
{ |
@@ -52,250 +52,250 @@ use common\logic\User\UserProducer\UserProducerManager; | |||
use common\logic\User\UserUserGroup\UserUserGroupContainer; | |||
use common\logic\User\UserUserGroup\UserUserGroupManager; | |||
trait BusinessLogicContainerTrait | |||
trait BusinessLogicTrait | |||
{ | |||
public function getUserProducerManager(): UserProducerManager | |||
{ | |||
return new UserProducerManager(); | |||
return UserProducerManager::getInstance(); | |||
} | |||
public function getOrderManager(): OrderManager | |||
{ | |||
return new OrderManager(); | |||
return OrderManager::getInstance(); | |||
} | |||
public function getTaxRateManager(): TaxRateManager | |||
{ | |||
return new TaxRateManager(); | |||
return TaxRateManager::getInstance(); | |||
} | |||
public function getDistributionManager(): DistributionManager | |||
{ | |||
return new DistributionManager(); | |||
return DistributionManager::getInstance(); | |||
} | |||
public function getPointSaleDistributionManager(): PointSaleDistributionManager | |||
{ | |||
return new PointSaleDistributionManager(); | |||
return PointSaleDistributionManager::getInstance(); | |||
} | |||
public function getProductDistributionManager(): ProductDistributionManager | |||
{ | |||
return new ProductDistributionManager(); | |||
return ProductDistributionManager::getInstance(); | |||
} | |||
public function getDeliveryNoteManager(): DeliveryNoteManager | |||
{ | |||
return new DeliveryNoteManager(); | |||
return DeliveryNoteManager::getInstance(); | |||
} | |||
public function getDocumentManager(): DocumentManager | |||
{ | |||
return new DocumentManager(); | |||
return DocumentManager::getInstance(); | |||
} | |||
public function getInvoiceManager(): InvoiceManager | |||
{ | |||
return new InvoiceManager(); | |||
return InvoiceManager::getInstance(); | |||
} | |||
public function getQuotationManager(): QuotationManager | |||
{ | |||
return new QuotationManager(); | |||
return QuotationManager::getInstance(); | |||
} | |||
public function getOrderStatusHistoryManager(): OrderStatusHistoryManager | |||
{ | |||
return new OrderStatusHistoryManager(); | |||
return OrderStatusHistoryManager::getInstance(); | |||
} | |||
public function getProductOrderManager(): ProductOrderManager | |||
{ | |||
return new ProductOrderManager(); | |||
return ProductOrderManager::getInstance(); | |||
} | |||
public function getPointSaleManager(): PointSaleManager | |||
{ | |||
return new PointSaleManager(); | |||
return PointSaleManager::getInstance(); | |||
} | |||
public function getUserPointSaleManager(): UserPointSaleManager | |||
{ | |||
return new UserPointSaleManager(); | |||
return UserPointSaleManager::getInstance(); | |||
} | |||
public function getProducerManager(): ProducerManager | |||
{ | |||
return new ProducerManager(); | |||
return ProducerManager::getInstance(); | |||
} | |||
public function getProducerPriceRangeManager(): ProducerPriceRangeManager | |||
{ | |||
return new ProducerPriceRangeManager(); | |||
return ProducerPriceRangeManager::getInstance(); | |||
} | |||
public function getProductManager(): ProductManager | |||
{ | |||
return new ProductManager(); | |||
return ProductManager::getInstance(); | |||
} | |||
public function getProductCategoryManager(): ProductCategoryManager | |||
{ | |||
return new ProductCategoryManager(); | |||
return ProductCategoryManager::getInstance(); | |||
} | |||
public function getProductPointSaleManager(): ProductPointSaleManager | |||
{ | |||
return new ProductPointSaleManager(); | |||
return ProductPointSaleManager::getInstance(); | |||
} | |||
public function getProductPriceManager(): ProductPriceManager | |||
{ | |||
return new ProductPriceManager(); | |||
return ProductPriceManager::getInstance(); | |||
} | |||
public function getProductSubscriptionManager(): ProductSubscriptionManager | |||
{ | |||
return new ProductSubscriptionManager(); | |||
return ProductSubscriptionManager::getInstance(); | |||
} | |||
public function getSubscriptionManager(): SubscriptionManager | |||
{ | |||
return new SubscriptionManager(); | |||
return SubscriptionManager::getInstance(); | |||
} | |||
public function getCreditHistoryManager(): CreditHistoryManager | |||
{ | |||
return new CreditHistoryManager(); | |||
return CreditHistoryManager::getInstance(); | |||
} | |||
public function getUserManager(): UserManager | |||
{ | |||
return new UserManager(); | |||
return UserManager::getInstance(); | |||
} | |||
public function getUserGroupManager(): UserGroupManager | |||
{ | |||
return new UserGroupManager(); | |||
return UserGroupManager::getInstance(); | |||
} | |||
public function getUserUserGroupManager(): UserUserGroupManager | |||
{ | |||
return new UserUserGroupManager(); | |||
return UserUserGroupManager::getInstance(); | |||
} | |||
public function getUserContainer(): UserContainer | |||
{ | |||
return new UserContainer(); | |||
return UserContainer::getInstance(); | |||
} | |||
public function getProducerContainer(): ProducerContainer | |||
{ | |||
return new ProducerContainer(); | |||
return ProducerContainer::getInstance(); | |||
} | |||
public function getProducerPriceRangeContainer(): ProducerPriceRangeContainer | |||
{ | |||
return new ProducerPriceRangeContainer(); | |||
return ProducerPriceRangeContainer::getInstance(); | |||
} | |||
public function getUserProducerContainer(): UserProducerContainer | |||
{ | |||
return new UserProducerContainer(); | |||
return UserProducerContainer::getInstance(); | |||
} | |||
public function getCreditHistoryContainer(): CreditHistoryContainer | |||
{ | |||
return new CreditHistoryContainer(); | |||
return CreditHistoryContainer::getInstance(); | |||
} | |||
public function getDocumentContainer(): DocumentContainer | |||
{ | |||
return new DocumentContainer(); | |||
return DocumentContainer::getInstance(); | |||
} | |||
public function getUserGroupContainer(): UserGroupContainer | |||
{ | |||
return new UserGroupContainer(); | |||
return UserGroupContainer::getInstance(); | |||
} | |||
public function getUserUserGroupContainer(): UserUserGroupContainer | |||
{ | |||
return new UserUserGroupContainer(); | |||
return UserUserGroupContainer::getInstance(); | |||
} | |||
public function getDistributionContainer(): DistributionContainer | |||
{ | |||
return new DistributionContainer(); | |||
return DistributionContainer::getInstance(); | |||
} | |||
public function getTaxRateContainer(): TaxRateContainer | |||
{ | |||
return new TaxRateContainer(); | |||
return TaxRateContainer::getInstance(); | |||
} | |||
public function getOrderContainer(): OrderContainer | |||
{ | |||
return new OrderContainer(); | |||
return OrderContainer::getInstance(); | |||
} | |||
public function getOrderSatusHistoryContainer(): OrderStatusHistoryContainer | |||
{ | |||
return new OrderStatusHistoryContainer(); | |||
return OrderStatusHistoryContainer::getInstance(); | |||
} | |||
public function getUserPointSaleContainer(): UserPointSaleContainer | |||
{ | |||
return new UserPointSaleContainer(); | |||
return UserPointSaleContainer::getInstance(); | |||
} | |||
public function getPointSaleContainer(): PointSaleContainer | |||
{ | |||
return new PointSaleContainer(); | |||
return PointSaleContainer::getInstance(); | |||
} | |||
public function getProductOrderContainer(): ProductOrderContainer | |||
{ | |||
return new ProductOrderContainer(); | |||
return ProductOrderContainer::getInstance(); | |||
} | |||
public function getProductContainer(): ProductContainer | |||
{ | |||
return new ProductContainer(); | |||
return ProductContainer::getInstance(); | |||
} | |||
public function getProductCategoryContainer(): ProductCategoryContainer | |||
{ | |||
return new ProductCategoryContainer(); | |||
return ProductCategoryContainer::getInstance(); | |||
} | |||
public function getProductPointSaleContainer(): ProductPointSaleContainer | |||
{ | |||
return new ProductPointSaleContainer(); | |||
return ProductPointSaleContainer::getInstance(); | |||
} | |||
public function getProductPriceContainer(): ProductPriceContainer | |||
{ | |||
return new ProductPriceContainer(); | |||
return ProductPriceContainer::getInstance(); | |||
} | |||
public function getSubscriptionContainer(): SubscriptionContainer | |||
{ | |||
return new SubscriptionContainer(); | |||
return SubscriptionContainer::getInstance(); | |||
} | |||
public function getProductSubscriptionContainer(): ProductSubscriptionContainer | |||
{ | |||
return new ProductSubscriptionContainer(); | |||
return ProductSubscriptionContainer::getInstance(); | |||
} | |||
public function getPointSaleDistributionContainer(): PointSaleDistributionContainer | |||
{ | |||
return new PointSaleDistributionContainer(); | |||
return PointSaleDistributionContainer::getInstance(); | |||
} | |||
public function getProductDistributionContainer(): ProductDistributionContainer | |||
{ | |||
return new ProductDistributionContainer(); | |||
return ProductDistributionContainer::getInstance(); | |||
} | |||
} |
@@ -40,7 +40,7 @@ namespace common\components ; | |||
class View extends \yii\web\View | |||
{ | |||
use BusinessLogicContainerTrait; | |||
use BusinessLogicTrait; | |||
var $title ; | |||
var $page_title ; |
@@ -39,13 +39,13 @@ termes. | |||
namespace common\controllers; | |||
use common\components\BusinessLogic; | |||
use common\components\BusinessLogicContainerTrait; | |||
use common\components\BusinessLogicTrait; | |||
use common\logic\User\User\User; | |||
use yii; | |||
class CommonController extends \yii\web\Controller | |||
{ | |||
use BusinessLogicContainerTrait; | |||
use BusinessLogicTrait; | |||
public function beforeAction($event) | |||
{ |
@@ -4,7 +4,7 @@ namespace common\logic; | |||
use yii\db\ActiveRecord; | |||
class BaseBuilder extends BaseService | |||
abstract class AbstractBuilder extends AbstractService implements BuilderInterface | |||
{ | |||
public function saveCreate(ActiveRecord $model): bool | |||
{ | |||
@@ -18,6 +18,6 @@ class BaseBuilder extends BaseService | |||
public function delete(ActiveRecord $model): bool | |||
{ | |||
$model->delete(); | |||
return $model->delete(); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace common\logic; | |||
abstract class AbstractContainer extends AbstractSingleton implements ContainerInterface | |||
{ | |||
} |
@@ -4,7 +4,7 @@ namespace common\logic; | |||
use yii\base\ErrorException; | |||
class BaseManager | |||
abstract class AbstractManager extends AbstractSingleton implements ManagerInterface | |||
{ | |||
protected ContainerInterface $container; | |||
@@ -13,7 +13,7 @@ class BaseManager | |||
foreach($this->getContainer()->getServices() as $serviceClass) { | |||
if(method_exists($serviceClass, $method)) { | |||
return call_user_func_array( | |||
[new $serviceClass, $method], | |||
[$serviceClass::getInstance(), $method], | |||
$args | |||
); | |||
} | |||
@@ -31,4 +31,10 @@ class BaseManager | |||
{ | |||
return $this->container; | |||
} | |||
public function initContainer(): void | |||
{ | |||
$containerFqcn = $this->getContainerFqcn(); | |||
$this->setContainer(new $containerFqcn); | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace common\logic; | |||
abstract class AbstractRepository extends AbstractService implements RepositoryInterface | |||
{ | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace common\logic; | |||
class AbstractRepositoryQuery extends AbstractService implements RepositoryQueryInterface | |||
{ | |||
} |
@@ -4,12 +4,13 @@ namespace common\logic; | |||
use yii\base\ErrorException; | |||
class BaseService | |||
abstract class AbstractService extends AbstractSingleton implements ServiceInterface | |||
{ | |||
protected function getHierarchy(): array | |||
{ | |||
return [ | |||
SolverInterface::class, | |||
RepositoryQueryInterface::class, | |||
RepositoryInterface::class, | |||
BuilderInterface::class, | |||
ResolverInterface::class, | |||
@@ -26,6 +27,10 @@ class BaseService | |||
return new $serviceClass; | |||
} | |||
protected function loadDependencies(): void | |||
{ | |||
} | |||
protected function respectHierarchy(string $serviceClassAsked): bool | |||
{ | |||
$domain = \Yii::$app->logic; |
@@ -0,0 +1,36 @@ | |||
<?php | |||
namespace common\logic; | |||
abstract class AbstractSingleton | |||
{ | |||
private static $instances = array(); | |||
final private function __construct() | |||
{ | |||
} | |||
final public function __clone() | |||
{ | |||
trigger_error("Le clonage n'est pas autorisé.", E_USER_ERROR); | |||
} | |||
final public static function getInstance() | |||
{ | |||
$c = get_called_class(); | |||
if (!isset(self::$instances[$c])) { | |||
self::$instances[$c] = new $c; | |||
if(in_array(ManagerInterface::class, class_implements(self::$instances[$c]))) { | |||
self::$instances[$c]->initContainer(); | |||
} | |||
if(in_array(ServiceInterface::class, class_implements(self::$instances[$c]))) { | |||
self::$instances[$c]->loadDependencies(); | |||
} | |||
} | |||
return self::$instances[$c]; | |||
} | |||
} |
@@ -2,10 +2,9 @@ | |||
namespace common\logic\Config\TaxRate; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BuilderInterface; | |||
use common\logic\AbstractBuilder; | |||
class TaxRateBuilder extends BaseBuilder implements BuilderInterface | |||
class TaxRateBuilder extends AbstractBuilder | |||
{ | |||
public function instanciateTaxRate(): TaxRate | |||
{ |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Config\TaxRate; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class TaxRateContainer implements ContainerInterface | |||
class TaxRateContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -21,11 +21,11 @@ class TaxRateContainer implements ContainerInterface | |||
public function getBuilder(): TaxRateBuilder | |||
{ | |||
return new TaxRateBuilder(); | |||
return TaxRateBuilder::getInstance(); | |||
} | |||
public function getRepository(): TaxRateRepository | |||
{ | |||
return new TaxRateRepository(); | |||
return TaxRateRepository::getInstance(); | |||
} | |||
} |
@@ -2,16 +2,16 @@ | |||
namespace common\logic\Config\TaxRate; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin TaxRateRepository | |||
* @mixin TaxRateBuilder | |||
*/ | |||
class TaxRateManager extends BaseManager | |||
class TaxRateManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new TaxRateContainer()); | |||
return TaxRateContainer::class; | |||
} | |||
} |
@@ -2,11 +2,17 @@ | |||
namespace common\logic\Config\TaxRate; | |||
use common\logic\BaseService; | |||
use common\logic\RepositoryInterface; | |||
use common\logic\AbstractRepository; | |||
class TaxRateRepository extends BaseService implements RepositoryInterface | |||
class TaxRateRepository extends AbstractRepository | |||
{ | |||
protected TaxRateRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(TaxRateRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Config\TaxRate; | |||
use common\logic\AbstractRepositoryQuery; | |||
class TaxRateRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\BaseBuilder; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistribution; | |||
use common\logic\Distribution\PointSaleDistribution\PointSaleDistributionBuilder; | |||
@@ -19,7 +19,7 @@ use common\logic\Product\Product\ProductRepository; | |||
use common\logic\User\UserProducer\UserProducerRepository; | |||
use yii\base\Event; | |||
class DistributionBuilder extends BaseBuilder implements BuilderInterface | |||
class DistributionBuilder extends AbstractBuilder | |||
{ | |||
protected DistributionRepository $distributionRepository; | |||
protected DistributionSolver $distributionSolver; | |||
@@ -32,7 +32,7 @@ class DistributionBuilder extends BaseBuilder implements BuilderInterface | |||
protected UserProducerRepository $userProducerRepository; | |||
protected ProductOrderBuilder $productOrderBuilder; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->distributionRepository = $this->loadService(DistributionRepository::class); | |||
$this->distributionSolver = $this->loadService(DistributionSolver::class); | |||
@@ -77,7 +77,7 @@ class DistributionBuilder extends BaseBuilder implements BuilderInterface | |||
public function createPointSaleDistributions(Distribution $distribution): void | |||
{ | |||
$countPointSaleDistribution = $this->pointSaleDistributionRepository->countPointSaleDistributionByDistribution($distribution); | |||
$countPointSaleDistribution = $this->pointSaleDistributionRepository->countPointSaleDistributionsByDistribution($distribution); | |||
if (!$countPointSaleDistribution) { | |||
$this->pointSaleDistributionBuilder->createAllPointSaleDistributions($distribution, true); | |||
} | |||
@@ -86,7 +86,7 @@ class DistributionBuilder extends BaseBuilder implements BuilderInterface | |||
public function createProductDistributions(Distribution $distribution): void | |||
{ | |||
$productArray = $this->productRepository->findProducts(); | |||
$countProductDistribution = $this->productDistributionRepository->countProductDistributionByDistribution($distribution); | |||
$countProductDistribution = $this->productDistributionRepository->countProductDistributionsByDistribution($distribution); | |||
if (!$countProductDistribution) { | |||
foreach ($productArray as $product) { | |||
@@ -164,7 +164,7 @@ class DistributionBuilder extends BaseBuilder implements BuilderInterface | |||
$userProducer = $this->userProducerRepository->findOneUserProducer($user, $distribution->producer); | |||
} | |||
$this->productOrderBuilder->updatePrice( | |||
$this->productOrderBuilder->updateProductOrderPrice( | |||
$productOrder, | |||
$user, | |||
$userProducer, |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class DistributionContainer implements ContainerInterface | |||
class DistributionContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -22,16 +22,16 @@ class DistributionContainer implements ContainerInterface | |||
public function getSolver(): DistributionSolver | |||
{ | |||
return new DistributionSolver(); | |||
return DistributionSolver::getInstance(); | |||
} | |||
public function getRepository(): DistributionRepository | |||
{ | |||
return new DistributionRepository(); | |||
return DistributionRepository::getInstance(); | |||
} | |||
public function getBuilder(): DistributionBuilder | |||
{ | |||
return new DistributionBuilder(); | |||
return DistributionBuilder::getInstance(); | |||
} | |||
} |
@@ -2,17 +2,17 @@ | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin DistributionSolver | |||
* @mixin DistributionRepository | |||
* @mixin DistributionBuilder | |||
*/ | |||
class DistributionManager extends BaseManager | |||
class DistributionManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new DistributionContainer()); | |||
return DistributionContainer::class; | |||
} | |||
} |
@@ -3,19 +3,20 @@ | |||
namespace common\logic\Distribution\Distribution; | |||
use common\helpers\GlobalParam; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\RepositoryInterface; | |||
use common\logic\Subscription\Subscription\Subscription; | |||
use common\logic\Subscription\Subscription\SubscriptionSolver; | |||
class DistributionRepository extends BaseService implements RepositoryInterface | |||
class DistributionRepository extends AbstractRepository | |||
{ | |||
protected DistributionRepositoryQuery $query; | |||
protected DistributionSolver $distributionSolver; | |||
protected SubscriptionSolver $subscriptionSolver; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(DistributionRepositoryQuery::class); | |||
$this->distributionSolver = $this->loadService(DistributionSolver::class); | |||
$this->subscriptionSolver = $this->loadService(SubscriptionSolver::class); | |||
} |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class DistributionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -3,12 +3,12 @@ | |||
namespace common\logic\Distribution\Distribution; | |||
use common\helpers\GlobalParam; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
use common\logic\Product\Product\Product; | |||
use common\logic\SolverInterface; | |||
class DistributionSolver extends BaseService implements SolverInterface | |||
class DistributionSolver extends AbstractService implements SolverInterface | |||
{ | |||
public function getDistributionDayAsString(Distribution $distribution): string | |||
{ |
@@ -2,20 +2,19 @@ | |||
namespace common\logic\Distribution\PointSaleDistribution; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BuilderInterface; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Distribution\Distribution\DistributionRepository; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
use common\logic\PointSale\PointSale\PointSaleRepository; | |||
class PointSaleDistributionBuilder extends BaseBuilder implements BuilderInterface | |||
class PointSaleDistributionBuilder extends AbstractBuilder | |||
{ | |||
protected PointSaleDistributionRepository $pointSaleDistributionRepository; | |||
protected PointSaleRepository $pointSaleRepository; | |||
protected DistributionRepository $distributionRepository; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->pointSaleDistributionRepository = $this->loadService(PointSaleDistributionRepository::class); | |||
$this->pointSaleRepository = $this->loadService(PointSaleRepository::class); |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Distribution\PointSaleDistribution; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class PointSaleDistributionContainer implements ContainerInterface | |||
class PointSaleDistributionContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -21,11 +21,11 @@ class PointSaleDistributionContainer implements ContainerInterface | |||
public function getRepository(): PointSaleDistributionRepository | |||
{ | |||
return new PointSaleDistributionRepository(); | |||
return PointSaleDistributionRepository::getInstance(); | |||
} | |||
public function getBuilder(): PointSaleDistributionBuilder | |||
{ | |||
return new PointSaleDistributionBuilder(); | |||
return PointSaleDistributionBuilder::getInstance(); | |||
} | |||
} |
@@ -2,16 +2,16 @@ | |||
namespace common\logic\Distribution\PointSaleDistribution; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin PointSaleDistributionRepository | |||
* @mixin PointSaleDistributionBuilder | |||
*/ | |||
class PointSaleDistributionManager extends BaseManager | |||
class PointSaleDistributionManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new PointSaleDistributionContainer()); | |||
return PointSaleDistributionContainer::class; | |||
} | |||
} |
@@ -2,13 +2,20 @@ | |||
namespace common\logic\Distribution\PointSaleDistribution; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Distribution\Distribution\PointSaleDistributionRepositoryQuery; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
use common\logic\RepositoryInterface; | |||
class PointSaleDistributionRepository extends BaseService implements RepositoryInterface | |||
class PointSaleDistributionRepository extends AbstractRepository | |||
{ | |||
protected PointSaleDistributionRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(PointSaleDistributionRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class PointSaleDistributionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -2,20 +2,20 @@ | |||
namespace common\logic\Distribution\ProductDistribution; | |||
use common\logic\BaseBuilder; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Distribution\Distribution\DistributionSolver; | |||
use common\logic\Product\Product\Product; | |||
use common\logic\Product\Product\ProductSolver; | |||
class ProductDistributionBuilder extends BaseBuilder implements BuilderInterface | |||
class ProductDistributionBuilder extends AbstractBuilder | |||
{ | |||
protected ProductDistributionRepository $productDistributionRepository; | |||
protected DistributionSolver $distributionSolver; | |||
protected ProductSolver $productSolver; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->productDistributionRepository = $this->loadService(ProductDistributionRepository::class); | |||
$this->distributionSolver = $this->loadService(DistributionSolver::class); |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Distribution\ProductDistribution; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class ProductDistributionContainer implements ContainerInterface | |||
class ProductDistributionContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -21,11 +21,11 @@ class ProductDistributionContainer implements ContainerInterface | |||
public function getRepository(): ProductDistributionRepository | |||
{ | |||
return new ProductDistributionRepository(); | |||
return ProductDistributionRepository::getInstance(); | |||
} | |||
public function getBuilder(): ProductDistributionBuilder | |||
{ | |||
return new ProductDistributionBuilder(); | |||
return ProductDistributionBuilder::getInstance(); | |||
} | |||
} |
@@ -2,16 +2,16 @@ | |||
namespace common\logic\Distribution\ProductDistribution; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin ProductDistributionRepository | |||
* @mixin ProductDistributionBuilder | |||
*/ | |||
class ProductDistributionManager extends BaseManager | |||
class ProductDistributionManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new ProductDistributionContainer()); | |||
return ProductDistributionContainer::class; | |||
} | |||
} |
@@ -2,14 +2,20 @@ | |||
namespace common\logic\Distribution\ProductDistribution; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Order\Order\Order; | |||
use common\logic\Distribution\Distribution\ProductDistributionRepositoryQuery; | |||
use common\logic\Product\Product\Product; | |||
use common\logic\RepositoryInterface; | |||
class ProductDistributionRepository extends BaseService implements RepositoryInterface | |||
class ProductDistributionRepository extends AbstractRepository | |||
{ | |||
protected ProductDistributionRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductDistributionRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class ProductDistributionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -2,11 +2,9 @@ | |||
namespace common\logic\Document\DeliveryNote; | |||
use common\logic\BaseService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Document\Document\DocumentBuilder; | |||
class DeliveryNoteBuilder extends DocumentBuilder implements BuilderInterface | |||
class DeliveryNoteBuilder extends DocumentBuilder | |||
{ | |||
public function instanciateDeliveryNote(): DeliveryNote | |||
{ |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Document\DeliveryNote; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class DeliveryNoteContainer implements ContainerInterface | |||
class DeliveryNoteContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -21,11 +21,11 @@ class DeliveryNoteContainer implements ContainerInterface | |||
public function getFactory(): DeliveryNoteBuilder | |||
{ | |||
return new DeliveryNoteBuilder(); | |||
return DeliveryNoteBuilder::getInstance(); | |||
} | |||
public function getSolver(): DeliveryNoteSolver | |||
{ | |||
return new DeliveryNoteSolver(); | |||
return DeliveryNoteSolver::getInstance(); | |||
} | |||
} |
@@ -12,8 +12,8 @@ use common\logic\PointSale\PointSale\DeliveryNoteRepository; | |||
*/ | |||
class DeliveryNoteManager extends DocumentManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new DeliveryNoteContainer()); | |||
return DeliveryNoteContainer::class; | |||
} | |||
} |
@@ -2,12 +2,19 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\DeliveryNoteRepositoryQuery; | |||
use common\logic\Document\DeliveryNote\DeliveryNote; | |||
use common\logic\RepositoryInterface; | |||
class DeliveryNoteRepository extends BaseService implements RepositoryInterface | |||
class DeliveryNoteRepository extends AbstractRepository | |||
{ | |||
protected DeliveryNoteRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(DeliveryNoteRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class DeliveryNoteRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -59,7 +59,7 @@ class DeliveryNoteSearch extends DeliveryNote | |||
public function search($params) | |||
{ | |||
$deliveryNoteRepository = new DeliveryNoteRepository(); | |||
$deliveryNoteRepository = DeliveryNoteRepository::getInstance(); | |||
$optionsSearch = $deliveryNoteRepository->getDefaultOptionsSearch(); | |||
$query = DeliveryNote::find() |
@@ -2,7 +2,6 @@ | |||
namespace common\logic\Document\DeliveryNote; | |||
use common\logic\BaseService; | |||
use common\logic\Document\Document\DocumentSolver; | |||
use common\logic\Document\Invoice\Invoice; | |||
use common\logic\SolverInterface; |
@@ -2,19 +2,15 @@ | |||
namespace common\logic\Document\Document; | |||
use common\logic\BaseService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\Producer\Producer\ProducerRepository; | |||
use kartik\mpdf\Pdf; | |||
use yii\helpers\Html; | |||
class DocumentBuilder extends BaseService implements BuilderInterface | |||
class DocumentBuilder extends AbstractBuilder | |||
{ | |||
protected DocumentSolver $documentSolver; | |||
protected ProducerRepository $producerRepository; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->documentSolver = $this->loadService(DocumentSolver::class); | |||
$this->producerRepository = $this->loadService(ProducerRepository::class); |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Document\Document; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class DocumentContainer implements ContainerInterface | |||
class DocumentContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -22,16 +22,16 @@ class DocumentContainer implements ContainerInterface | |||
public function getSolver(): DocumentSolver | |||
{ | |||
return new DocumentSolver(); | |||
return DocumentSolver::getInstance(); | |||
} | |||
public function getBuilder(): DocumentBuilder | |||
{ | |||
return new DocumentBuilder(); | |||
return DocumentBuilder::getInstance(); | |||
} | |||
public function getUtils(): DocumentUtils | |||
{ | |||
return new DocumentUtils(); | |||
return DocumentUtils::getInstance(); | |||
} | |||
} |
@@ -2,17 +2,17 @@ | |||
namespace common\logic\Document\Document; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin DocumentSolver | |||
* @mixin DocumentBuilder | |||
* @mixin DocumentUtils | |||
*/ | |||
class DocumentManager extends BaseManager | |||
class DocumentManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new DocumentContainer()); | |||
return DocumentContainer::class; | |||
} | |||
} |
@@ -3,12 +3,12 @@ | |||
namespace common\logic\Document\Document; | |||
use common\helpers\Price; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\Order\Order\Order; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
use common\logic\SolverInterface; | |||
class DocumentSolver extends BaseService implements SolverInterface | |||
class DocumentSolver extends AbstractService implements SolverInterface | |||
{ | |||
public function getAmount(DocumentInterface $document, string $type = Order::AMOUNT_TOTAL, bool $format = false) | |||
{ |
@@ -3,7 +3,7 @@ | |||
namespace common\logic\Document\Document; | |||
use common\helpers\GlobalParam; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\Producer\Producer\ProducerRepository; | |||
use common\logic\Producer\Producer\ProducerSolver; | |||
use common\logic\UtilsInterface; | |||
@@ -11,14 +11,14 @@ use kartik\mpdf\Pdf; | |||
use yii\base\ErrorException; | |||
use yii\helpers\Html; | |||
class DocumentUtils extends BaseService implements UtilsInterface | |||
class DocumentUtils extends AbstractService implements UtilsInterface | |||
{ | |||
protected DocumentSolver $documentSolver; | |||
protected DocumentBuilder $documentBuilder; | |||
protected ProducerSolver $producerSolver; | |||
protected ProducerRepository $producerRepository; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->documentSolver = $this->loadService(DocumentSolver::class); | |||
$this->documentBuilder = $this->loadService(DocumentBuilder::class); |
@@ -2,11 +2,9 @@ | |||
namespace common\logic\Document\Invoice; | |||
use common\logic\BaseService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Document\Document\DocumentBuilder; | |||
class InvoiceBuilder extends DocumentBuilder implements BuilderInterface | |||
class InvoiceBuilder extends DocumentBuilder | |||
{ | |||
public function instanciateInvoice(): Invoice | |||
{ |
@@ -2,12 +2,11 @@ | |||
namespace common\logic\Document\Invoice; | |||
use common\logic\ContainerInterface; | |||
use common\logic\Document\Document\DocumentBuilder; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Document\Document\DocumentSolver; | |||
use common\logic\PointSale\PointSale\InvoiceRepository; | |||
class InvoiceContainer implements ContainerInterface | |||
class InvoiceContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -24,16 +23,16 @@ class InvoiceContainer implements ContainerInterface | |||
public function getSolver(): DocumentSolver | |||
{ | |||
return new DocumentSolver(); | |||
return DocumentSolver::getInstance(); | |||
} | |||
public function getRepository(): InvoiceRepository | |||
{ | |||
return new InvoiceRepository(); | |||
return InvoiceRepository::getInstance(); | |||
} | |||
public function getBuilder(): InvoiceBuilder | |||
{ | |||
return new InvoiceBuilder(); | |||
return InvoiceBuilder::getInstance(); | |||
} | |||
} |
@@ -11,8 +11,8 @@ use common\logic\PointSale\PointSale\InvoiceRepository; | |||
*/ | |||
class InvoiceManager extends DocumentManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new InvoiceContainer()); | |||
return InvoiceContainer::class; | |||
} | |||
} |
@@ -2,12 +2,19 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\InvoiceRepositoryQuery; | |||
use common\logic\Document\Invoice\Invoice; | |||
use common\logic\RepositoryInterface; | |||
class InvoiceRepository extends BaseService implements RepositoryInterface | |||
class InvoiceRepository extends AbstractRepository | |||
{ | |||
protected InvoiceRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(InvoiceRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class InvoiceRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -39,6 +39,8 @@ | |||
namespace common\logic\Document\Invoice; | |||
use common\helpers\GlobalParam; | |||
use common\logic\PointSale\PointSale\InvoiceRepository; | |||
use yii\data\ActiveDataProvider; | |||
class InvoiceSearch extends Invoice | |||
{ | |||
@@ -55,7 +57,8 @@ class InvoiceSearch extends Invoice | |||
public function search($params) | |||
{ | |||
$optionsSearch = self::getDefaultOptionsSearch(); | |||
$invoiceRepository = InvoiceRepository::getInstance(); | |||
$optionsSearch = $invoiceRepository->getDefaultOptionsSearch(); | |||
$query = Invoice::find() | |||
->with($optionsSearch['with']) |
@@ -2,10 +2,9 @@ | |||
namespace common\logic\Document\Quotation; | |||
use common\logic\BaseService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\AbstractBuilder; | |||
class QuotationBuilder extends BaseService implements BuilderInterface | |||
class QuotationBuilder extends AbstractBuilder | |||
{ | |||
public function instanciateQuotation(): Quotation | |||
{ |
@@ -2,15 +2,13 @@ | |||
namespace common\logic\Document\Invoice; | |||
use common\logic\ContainerInterface; | |||
use common\logic\Document\Document\DocumentBuilder; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Document\Document\DocumentSolver; | |||
use common\logic\Document\Quotation\QuotationBuilder; | |||
use common\logic\Document\Quotation\QuotationFactory; | |||
use common\logic\Document\Quotation\Quotation; | |||
use common\logic\PointSale\PointSale\QuotationRepository; | |||
class QuotationContainer implements ContainerInterface | |||
class QuotationContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -26,16 +24,16 @@ class QuotationContainer implements ContainerInterface | |||
public function getSolver(): DocumentSolver | |||
{ | |||
return new DocumentSolver(); | |||
return DocumentSolver::getInstance(); | |||
} | |||
public function getRepository(): QuotationRepository | |||
{ | |||
return new QuotationRepository(); | |||
return QuotationRepository::getInstance(); | |||
} | |||
public function getBuilder(): QuotationBuilder | |||
{ | |||
return new QuotationBuilder(); | |||
return QuotationBuilder::getInstance(); | |||
} | |||
} |
@@ -12,8 +12,8 @@ use common\logic\PointSale\PointSale\QuotationRepository; | |||
*/ | |||
class QuotationManager extends DocumentManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new QuotationContainer()); | |||
return QuotationContainer::class; | |||
} | |||
} |
@@ -2,11 +2,18 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\BaseService; | |||
use common\logic\RepositoryInterface; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\QuotationRepositoryQuery; | |||
class QuotationRepository extends BaseService implements RepositoryInterface | |||
class QuotationRepository extends AbstractRepository | |||
{ | |||
protected QuotationRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(QuotationRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class QuotationRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -39,49 +39,51 @@ | |||
namespace common\logic\Document\Quotation; | |||
use common\helpers\GlobalParam; | |||
use common\logic\PointSale\PointSale\QuotationRepository; | |||
use yii\data\ActiveDataProvider; | |||
class QuotationSearch extends Quotation | |||
{ | |||
public function rules() | |||
{ | |||
return [ | |||
[[], 'safe'], | |||
[['comment', 'address', 'status'], 'string'], | |||
[['id_user'], 'integer'], | |||
[['name', 'reference'], 'string', 'max' => 255], | |||
]; | |||
} | |||
public function rules() | |||
{ | |||
return [ | |||
[[], 'safe'], | |||
[['comment', 'address', 'status'], 'string'], | |||
[['id_user'], 'integer'], | |||
[['name', 'reference'], 'string', 'max' => 255], | |||
]; | |||
} | |||
public function search($params) | |||
{ | |||
$optionsSearch = self::getDefaultOptionsSearch(); | |||
public function search($params) | |||
{ | |||
$quotationRepository = QuotationRepository::getInstance(); | |||
$optionsSearch = $quotationRepository->getDefaultOptionsSearch(); | |||
$query = Quotation::find() | |||
->with($optionsSearch['with']) | |||
->joinWith($optionsSearch['join_with']) | |||
->where(['quotation.id_producer' => GlobalParam::getCurrentProducerId()]) | |||
->orderBy('quotation.status ASC, quotation.reference DESC') | |||
->groupBy('quotation.id'); | |||
$query = Quotation::find() | |||
->with($optionsSearch['with']) | |||
->joinWith($optionsSearch['join_with']) | |||
->where(['quotation.id_producer' => GlobalParam::getCurrentProducerId()]) | |||
->orderBy('quotation.status ASC, quotation.reference DESC') | |||
->groupBy('quotation.id'); | |||
$dataProvider = new ActiveDataProvider([ | |||
'query' => $query, | |||
'sort' => ['attributes' => ['name', 'reference', 'date']], | |||
'pagination' => [ | |||
'pageSize' => 20, | |||
], | |||
]); | |||
$dataProvider = new ActiveDataProvider([ | |||
'query' => $query, | |||
'sort' => ['attributes' => ['name', 'reference', 'date']], | |||
'pagination' => [ | |||
'pageSize' => 20, | |||
], | |||
]); | |||
$this->load($params); | |||
if (!$this->validate()) { | |||
return $dataProvider; | |||
} | |||
$this->load($params); | |||
if (!$this->validate()) { | |||
return $dataProvider; | |||
} | |||
$query->andFilterWhere(['like', 'quotation.name', $this->name]); | |||
$query->andFilterWhere(['like', 'quotation.reference', $this->reference]); | |||
$query->andFilterWhere(['like', 'quotation.status', $this->status]); | |||
$query->andFilterWhere(['like', 'quotation.name', $this->name]); | |||
$query->andFilterWhere(['like', 'quotation.reference', $this->reference]); | |||
$query->andFilterWhere(['like', 'quotation.status', $this->status]); | |||
return $dataProvider; | |||
} | |||
return $dataProvider; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace common\logic; | |||
interface ManagerInterface | |||
{ | |||
public function getContainerFqcn(): string; | |||
} |
@@ -5,8 +5,8 @@ namespace common\logic\Order\Order; | |||
use common\helpers\GlobalParam; | |||
use common\helpers\MeanPayment; | |||
use common\helpers\Price; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\AbstractService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Config\TaxRate\TaxRate; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
@@ -33,7 +33,7 @@ use common\logic\User\User\UserSolver; | |||
use common\logic\User\UserProducer\UserProducerRepository; | |||
use yii\web\NotFoundHttpException; | |||
class OrderBuilder extends BaseBuilder implements BuilderInterface | |||
class OrderBuilder extends AbstractBuilder | |||
{ | |||
protected UserSolver $userSolver; | |||
protected OrderSolver $orderSolver; | |||
@@ -53,7 +53,7 @@ class OrderBuilder extends BaseBuilder implements BuilderInterface | |||
protected SubscriptionRepository $subscriptionRepository; | |||
protected SubscriptionSolver $subscriptionSolver; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->userSolver = $this->loadService(UserSolver::class); | |||
$this->orderSolver = $this->loadService(OrderSolver::class); |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Order\Order; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class OrderContainer implements ContainerInterface | |||
class OrderContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -23,21 +23,21 @@ class OrderContainer implements ContainerInterface | |||
public function getSolver(): OrderSolver | |||
{ | |||
return new OrderSolver(); | |||
return OrderSolver::getInstance(); | |||
} | |||
public function getRepository(): OrderRepository | |||
{ | |||
return new OrderRepository(); | |||
return OrderRepository::getInstance(); | |||
} | |||
public function getBuilder(): OrderBuilder | |||
{ | |||
return new OrderBuilder(); | |||
return OrderBuilder::getInstance(); | |||
} | |||
public function getUtils(): OrderUtils | |||
{ | |||
return new OrderUtils(); | |||
return OrderUtils::getInstance(); | |||
} | |||
} |
@@ -2,7 +2,7 @@ | |||
namespace common\logic\Order\Order; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
use common\logic\Config\TaxRate\TaxRate; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Document\Document\Document; | |||
@@ -18,10 +18,10 @@ use yii\db\Query; | |||
* @mixin OrderRepository | |||
* @mixin OrderBuilder | |||
*/ | |||
class OrderManager extends BaseManager | |||
class OrderManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new OrderContainer()); | |||
return OrderContainer::class; | |||
} | |||
} |
@@ -2,28 +2,28 @@ | |||
namespace common\logic\Order\Order; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Distribution\ProductDistribution\ProductDistribution; | |||
use common\logic\Distribution\Distribution\OrderRepositoryQuery; | |||
use common\logic\Distribution\ProductDistribution\ProductDistributionRepository; | |||
use common\logic\Order\ProductOrder\ProductOrder; | |||
use common\logic\Order\ProductOrder\ProductOrderRepository; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\Producer\Producer\ProducerRepository; | |||
use common\logic\Product\Product\Product; | |||
use common\logic\RepositoryInterface; | |||
use common\logic\User\User\User; | |||
use yii\helpers\Html; | |||
class OrderRepository extends BaseService implements RepositoryInterface | |||
class OrderRepository extends AbstractRepository | |||
{ | |||
protected OrderRepositoryQuery $query; | |||
protected ProductOrderRepository $productOrderRepository; | |||
protected ProducerRepository $producerRepository; | |||
protected OrderSolver $orderSolver; | |||
protected ProductDistributionRepository $productDistributionRepository; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(OrderRepositoryQuery::class); | |||
$this->productOrderRepository = $this->loadService(ProductOrderRepository::class); | |||
$this->producerRepository = $this->loadService(ProducerRepository::class); | |||
$this->orderSolver = $this->loadService(OrderSolver::class); |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class OrderRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -38,11 +38,14 @@ termes. | |||
namespace common\logic\Order\Order ; | |||
use yii\data\ActiveDataProvider; | |||
class OrderSearch extends Order | |||
{ | |||
public function search($params) | |||
{ | |||
$optionsSearch = self::getDefaultOptionsSearch() ; | |||
$orderRepository = OrderRepository::getInstance(); | |||
$optionsSearch = $orderRepository->getDefaultOptionsSearch() ; | |||
$paramsSearch = []; | |||
if(isset($params['id_user'])) { |
@@ -4,7 +4,7 @@ namespace common\logic\Order\Order; | |||
use common\helpers\GlobalParam; | |||
use common\helpers\Price; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\Document\Document\Document; | |||
use common\logic\Document\Document\DocumentSolver; | |||
use common\logic\Order\ProductOrder\ProductOrder; | |||
@@ -16,12 +16,12 @@ use common\logic\User\User\UserSolver; | |||
use yii\helpers\Html; | |||
class OrderSolver extends BaseService implements SolverInterface | |||
class OrderSolver extends AbstractService implements SolverInterface | |||
{ | |||
protected UserSolver $userSolver; | |||
protected DocumentSolver $documentSolver; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->documentSolver = $this->loadService(DocumentSolver::class); | |||
$this->userSolver = $this->loadService(UserSolver::class); |
@@ -2,10 +2,10 @@ | |||
namespace common\logic\Order\Order; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\UtilsInterface; | |||
class OrderUtils extends BaseService implements UtilsInterface | |||
class OrderUtils extends AbstractService implements UtilsInterface | |||
{ | |||
} |
@@ -2,17 +2,16 @@ | |||
namespace common\logic\Order\OrderStatusHistory; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BuilderInterface; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\Order\Order\Order; | |||
use common\logic\User\User\User; | |||
use common\logic\User\User\UserSolver; | |||
class OrderStatusHistoryBuilder extends BaseBuilder implements BuilderInterface | |||
class OrderStatusHistoryBuilder extends AbstractBuilder | |||
{ | |||
protected UserSolver $userSolver; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->userSolver = $this->loadService(UserSolver::class); | |||
} |
@@ -2,10 +2,10 @@ | |||
namespace common\logic\Order\OrderStatusHistory; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
use common\logic\PointSale\PointSale\OrderStatusHistoryRepository; | |||
class OrderStatusHistoryContainer implements ContainerInterface | |||
class OrderStatusHistoryContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -22,11 +22,11 @@ class OrderStatusHistoryContainer implements ContainerInterface | |||
public function getRepository(): OrderStatusHistoryRepository | |||
{ | |||
return new OrderStatusHistoryRepository(); | |||
return OrderStatusHistoryRepository::getInstance(); | |||
} | |||
public function getBuilder(): OrderStatusHistoryBuilder | |||
{ | |||
return new OrderStatusHistoryBuilder(); | |||
return OrderStatusHistoryBuilder::getInstance(); | |||
} | |||
} |
@@ -2,17 +2,17 @@ | |||
namespace common\logic\Order\OrderStatusHistory; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
use common\logic\PointSale\PointSale\OrderStatusHistoryRepository; | |||
/** | |||
* @mixin OrderStatusHistoryRepository | |||
* @mixin OrderStatusHistoryBuilder | |||
*/ | |||
class OrderStatusHistoryManager extends BaseManager | |||
class OrderStatusHistoryManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new OrderStatusHistoryContainer()); | |||
return OrderStatusHistoryContainer::class; | |||
} | |||
} |
@@ -2,11 +2,18 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\BaseService; | |||
use common\logic\RepositoryInterface; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\OrderStatusHistoryRepositoryQuery; | |||
class OrderStatusHistoryRepository extends BaseService implements RepositoryInterface | |||
class OrderStatusHistoryRepository extends AbstractRepository | |||
{ | |||
protected OrderStatusHistoryRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(OrderStatusHistoryRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class OrderStatusHistoryRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -2,8 +2,8 @@ | |||
namespace common\logic\Order\ProductOrder; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\AbstractService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Config\TaxRate\TaxRate; | |||
use common\logic\Order\Order\Order; | |||
@@ -13,11 +13,11 @@ use common\logic\Product\Product\ProductSolver; | |||
use common\logic\User\User\User; | |||
use common\logic\User\UserProducer\UserProducer; | |||
class ProductOrderBuilder extends BaseBuilder implements BuilderInterface | |||
class ProductOrderBuilder extends AbstractBuilder | |||
{ | |||
protected ProductSolver $productSolver; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->productSolver = $this->loadService(ProductSolver::class); | |||
} |
@@ -2,10 +2,9 @@ | |||
namespace common\logic\Order\ProductOrder; | |||
use common\logic\ContainerInterface; | |||
use common\logic\Order\ProductOrder\ProductOrderRepository; | |||
use common\logic\AbstractContainer; | |||
class ProductOrderContainer implements ContainerInterface | |||
class ProductOrderContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -23,16 +22,16 @@ class ProductOrderContainer implements ContainerInterface | |||
public function getSolver(): ProductOrderSolver | |||
{ | |||
return new ProductOrderSolver(); | |||
return ProductOrderSolver::getInstance(); | |||
} | |||
public function getRepository(): ProductOrderRepository | |||
{ | |||
return new ProductOrderRepository(); | |||
return ProductOrderRepository::getInstance(); | |||
} | |||
public function getBuilder(): ProductOrderBuilder | |||
{ | |||
return new ProductOrderBuilder(); | |||
return ProductOrderBuilder::getInstance(); | |||
} | |||
} |
@@ -2,17 +2,17 @@ | |||
namespace common\logic\Order\ProductOrder; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin ProductOrderSolver | |||
* @mixin ProductOrderRepository | |||
* @mixin ProductOrderBuilder | |||
*/ | |||
class ProductOrderManager extends BaseManager | |||
class ProductOrderManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new ProductOrderContainer()); | |||
return ProductOrderContainer::class; | |||
} | |||
} |
@@ -2,12 +2,19 @@ | |||
namespace common\logic\Order\ProductOrder; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\ProductOrderRepositoryQuery; | |||
use common\logic\Order\Order\Order; | |||
use common\logic\RepositoryInterface; | |||
class ProductOrderRepository extends BaseService implements RepositoryInterface | |||
class ProductOrderRepository extends AbstractRepository | |||
{ | |||
protected ProductOrderRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductOrderRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class ProductOrderRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -3,11 +3,11 @@ | |||
namespace common\logic\Order\ProductOrder; | |||
use common\helpers\Price; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\Order\Order\Order; | |||
use common\logic\SolverInterface; | |||
class ProductOrderSolver extends BaseService implements SolverInterface | |||
class ProductOrderSolver extends AbstractService implements SolverInterface | |||
{ | |||
/** | |||
* Retourne le prix du produit avec taxe |
@@ -2,8 +2,8 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\AbstractService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\PointSale\UserPointSale\UserPointSale; | |||
use common\logic\PointSale\UserPointSale\UserPointSaleBuilder; | |||
@@ -12,13 +12,13 @@ use common\logic\Producer\Producer\Producer; | |||
use common\logic\User\User\User; | |||
use common\logic\User\User\UserRepository; | |||
class PointSaleBuilder extends BaseBuilder implements BuilderInterface | |||
class PointSaleBuilder extends AbstractBuilder | |||
{ | |||
protected UserPointSaleBuilder $userPointSaleBuilder; | |||
protected UserRepository $userRepository; | |||
protected UserPointSaleRepository $userPointSaleRepository; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->userPointSaleBuilder = $this->loadService(UserPointSaleBuilder::class); | |||
$this->userRepository = $this->loadService(UserRepository::class); |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractContainer; | |||
class PointSaleContainer implements ContainerInterface | |||
class PointSaleContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -22,16 +22,16 @@ class PointSaleContainer implements ContainerInterface | |||
public function getSolver(): PointSaleSolver | |||
{ | |||
return new PointSaleSolver(); | |||
return PointSaleSolver::getInstance(); | |||
} | |||
public function getRepository(): PointSaleRepository | |||
{ | |||
return new PointSaleRepository(); | |||
return PointSaleRepository::getInstance(); | |||
} | |||
public function getBuilder(): PointSaleBuilder | |||
{ | |||
return new PointSaleBuilder(); | |||
return PointSaleBuilder::getInstance(); | |||
} | |||
} |
@@ -2,17 +2,17 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin PointSaleSolver | |||
* @mixin PointSaleRepository | |||
* @mixin PointSaleBuilder | |||
*/ | |||
class PointSaleManager extends BaseManager | |||
class PointSaleManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new PointSaleContainer()); | |||
return PointSaleContainer::class; | |||
} | |||
} |
@@ -3,14 +3,23 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\helpers\GlobalParam; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\AbstractService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\Distribution\Distribution\Distribution; | |||
use common\logic\Distribution\Distribution\PointSaleRepositoryQuery; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\RepositoryInterface; | |||
class PointSaleRepository extends BaseService implements RepositoryInterface | |||
class PointSaleRepository extends AbstractRepository | |||
{ | |||
protected PointSaleRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(PointSaleRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class PointSaleRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -39,6 +39,7 @@ termes. | |||
namespace common\logic\PointSale\PointSale ; | |||
use common\helpers\GlobalParam; | |||
use yii\data\ActiveDataProvider; | |||
class PointSaleSearch extends PointSale | |||
{ | |||
@@ -63,7 +64,8 @@ class PointSaleSearch extends PointSale | |||
public function search($params) | |||
{ | |||
$optionsSearch = self::getDefaultOptionsSearch() ; | |||
$pointSaleRepository = PointSaleRepository::getInstance(); | |||
$optionsSearch = $pointSaleRepository->getDefaultOptionsSearch() ; | |||
$query = PointSale::find() | |||
->with($optionsSearch['with']) |
@@ -3,11 +3,11 @@ | |||
namespace common\logic\PointSale\PointSale; | |||
use common\helpers\GlobalParam; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\SolverInterface; | |||
use yii\helpers\Html; | |||
class PointSaleSolver extends BaseService implements SolverInterface | |||
class PointSaleSolver extends AbstractService implements SolverInterface | |||
{ | |||
/** | |||
* Retourne le commentaire de l'utilisateur courant lié au point de vente. |
@@ -2,16 +2,16 @@ | |||
namespace common\logic\PointSale\UserPointSale; | |||
use common\logic\BaseBuilder; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\BuilderInterface; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
use common\logic\User\User\User; | |||
class UserPointSaleBuilder extends BaseBuilder implements BuilderInterface | |||
class UserPointSaleBuilder extends AbstractBuilder | |||
{ | |||
protected UserPointSaleRepository $userPointSaleRepository; | |||
public function __construct() | |||
public function loadDependencies(): void | |||
{ | |||
$this->userPointSaleRepository = $this->loadService(UserPointSaleRepository::class); | |||
} |
@@ -2,10 +2,9 @@ | |||
namespace common\logic\PointSale\UserPointSale; | |||
use common\logic\ContainerInterface; | |||
use common\logic\PointSale\UserPointSale\UserPointSaleRepository; | |||
use common\logic\AbstractContainer; | |||
class UserPointSaleContainer implements ContainerInterface | |||
class UserPointSaleContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
@@ -22,11 +21,11 @@ class UserPointSaleContainer implements ContainerInterface | |||
public function getRepository(): UserPointSaleRepository | |||
{ | |||
return new UserPointSaleRepository(); | |||
return UserPointSaleRepository::getInstance(); | |||
} | |||
public function getBuilder(): UserPointSaleBuilder | |||
{ | |||
return new UserPointSaleBuilder(); | |||
return UserPointSaleBuilder::getInstance(); | |||
} | |||
} |
@@ -2,16 +2,16 @@ | |||
namespace common\logic\PointSale\UserPointSale; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin UserPointSaleRepository | |||
* @mixin UserPointSaleBuilder | |||
*/ | |||
class UserPointSaleManager extends BaseManager | |||
class UserPointSaleManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
public function getContainerFqcn(): string | |||
{ | |||
$this->setContainer(new UserPointSaleContainer()); | |||
return UserPointSaleContainer::class; | |||
} | |||
} |
@@ -2,13 +2,20 @@ | |||
namespace common\logic\PointSale\UserPointSale; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\UserPointSaleRepositoryQuery; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
use common\logic\RepositoryInterface; | |||
use common\logic\User\User\User; | |||
class UserPointSaleRepository extends BaseService implements RepositoryInterface | |||
class UserPointSaleRepository extends AbstractRepository | |||
{ | |||
protected UserPointSaleRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(UserPointSaleRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
{ | |||
return [ |
@@ -0,0 +1,10 @@ | |||
<?php | |||
namespace common\logic\Distribution\Distribution; | |||
use common\logic\AbstractRepositoryQuery; | |||
class UserPointSaleRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
} |
@@ -4,8 +4,8 @@ namespace common\logic\Producer\Producer; | |||
use common\helpers\Opendistrib; | |||
use common\helpers\Password; | |||
use common\logic\BaseBuilder; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\AbstractService; | |||
use common\logic\BuilderInterface; | |||
use common\logic\User\User\User; | |||
use common\logic\User\UserProducer\UserProducer; | |||
@@ -13,7 +13,7 @@ use common\logic\User\UserProducer\UserProducerBuilder; | |||
use common\logic\User\UserProducer\UserProducerRepository; | |||
use common\helpers\Url; | |||
class ProducerBuilder extends BaseBuilder implements BuilderInterface | |||
class ProducerBuilder extends AbstractBuilder implements BuilderInterface | |||
{ | |||
protected ProducerRepository $producerRepository; | |||
protected UserProducerRepository $userProducerRepository; |
@@ -3,8 +3,9 @@ | |||
namespace common\logic\Producer\Producer; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractSingleton; | |||
class ProducerContainer implements ContainerInterface | |||
class ProducerContainer extends AbstractSingleton implements ContainerInterface | |||
{ | |||
public function getEntityFqcn(): string | |||
{ |
@@ -2,7 +2,7 @@ | |||
namespace common\logic\Producer\Producer; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin ProducerSolver | |||
@@ -10,7 +10,7 @@ use common\logic\BaseManager; | |||
* @mixin ProducerBuilder | |||
* @mixin ProducerUtils | |||
*/ | |||
class ProducerManager extends BaseManager | |||
class ProducerManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
{ |
@@ -5,7 +5,7 @@ namespace common\logic\Producer\Producer; | |||
use common\helpers\Departments; | |||
use common\helpers\GlobalParam; | |||
use common\helpers\Price; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\Document\Document\DocumentInterface; | |||
use common\logic\Document\Document\DocumentSolver; | |||
use common\logic\PointSale\PointSale\PointSale; | |||
@@ -15,7 +15,7 @@ use common\logic\RepositoryInterface; | |||
use common\logic\User\User\User; | |||
use yii\helpers\Html; | |||
class ProducerRepository extends BaseService implements RepositoryInterface | |||
class ProducerRepository extends AbstractService implements RepositoryInterface | |||
{ | |||
protected ProducerPriceRangeRepository $producerPriceRangeRepository; | |||
protected ProducerSolver $producerSolver; |
@@ -3,11 +3,11 @@ | |||
namespace common\logic\Producer\Producer; | |||
use common\helpers\GlobalParam; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\SolverInterface; | |||
use common\logic\User\User\User; | |||
class ProducerSolver extends BaseService implements SolverInterface | |||
class ProducerSolver extends AbstractService implements SolverInterface | |||
{ | |||
/** |
@@ -2,10 +2,10 @@ | |||
namespace common\logic\Producer\Producer; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\UtilsInterface; | |||
class ProducerUtils extends BaseService implements UtilsInterface | |||
class ProducerUtils extends AbstractService implements UtilsInterface | |||
{ | |||
public function sendEmailNewProducer(Producer $producer): void | |||
{ |
@@ -2,9 +2,9 @@ | |||
namespace common\logic\Producer\ProducerPriceRange; | |||
use common\logic\BaseBuilder; | |||
use common\logic\AbstractBuilder; | |||
class ProducerPriceRangeBuilder extends BaseBuilder | |||
class ProducerPriceRangeBuilder extends AbstractBuilder | |||
{ | |||
public function instanciateProducerPriceRange(): ProducerPriceRange | |||
{ |
@@ -3,8 +3,9 @@ | |||
namespace common\logic\Producer\ProducerPriceRange; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractSingleton; | |||
class ProducerPriceRangeContainer implements ContainerInterface | |||
class ProducerPriceRangeContainer extends AbstractSingleton implements ContainerInterface | |||
{ | |||
public function getEntityFqcn(): string | |||
{ |
@@ -2,13 +2,13 @@ | |||
namespace common\logic\Producer\ProducerPriceRange; | |||
use common\logic\BaseManager; | |||
use common\logic\AbstractManager; | |||
/** | |||
* @mixin ProducerPriceRangeRepository | |||
* @mixin ProducerPriceRangeBuilder | |||
*/ | |||
class ProducerPriceRangeManager extends BaseManager | |||
class ProducerPriceRangeManager extends AbstractManager | |||
{ | |||
public function __construct() | |||
{ |
@@ -3,10 +3,10 @@ | |||
namespace common\logic\Producer\ProducerPriceRange; | |||
use common\helpers\Price; | |||
use common\logic\BaseService; | |||
use common\logic\AbstractService; | |||
use common\logic\RepositoryInterface; | |||
class ProducerPriceRangeRepository extends BaseService implements RepositoryInterface | |||
class ProducerPriceRangeRepository extends AbstractService implements RepositoryInterface | |||
{ | |||
/** | |||
* Retourne les options de base nécessaires à la fonction de recherche. |
@@ -2,10 +2,10 @@ | |||
namespace common\logic\Product\Product; | |||
use common\logic\BaseBuilder; | |||
use common\logic\AbstractBuilder; | |||
use common\logic\BuilderInterface; | |||
class ProductBuilder extends BaseBuilder implements BuilderInterface | |||
class ProductBuilder extends AbstractBuilder implements BuilderInterface | |||
{ | |||
public function instanciateProduct(): Product | |||
{ |
@@ -3,8 +3,9 @@ | |||
namespace common\logic\Product\Product; | |||
use common\logic\ContainerInterface; | |||
use common\logic\AbstractSingleton; | |||
class ProductContainer implements ContainerInterface | |||
class ProductContainer extends AbstractSingleton implements ContainerInterface | |||
{ | |||
public function getEntityFqcn(): string | |||
{ |