public function getHierarchy(): array | public function getHierarchy(): array | ||||
{ | { | ||||
return [ | return [ | ||||
FactoryInterface::class, | |||||
SolverInterface::class, | SolverInterface::class, | ||||
RepositoryInterface::class, | RepositoryInterface::class, | ||||
BuilderInterface::class, | BuilderInterface::class, | ||||
FactoryInterface, SolverInterface ou BuilderInterface au service.'); | FactoryInterface, SolverInterface ou BuilderInterface au service.'); | ||||
} | } | ||||
public function isFactory(): bool | |||||
{ | |||||
return $this->classImplementsInterface(FactoryInterface::class); | |||||
} | |||||
public function isSolver(): bool | public function isSolver(): bool | ||||
{ | { | ||||
return $this->classImplementsInterface(SolverInterface::class); | return $this->classImplementsInterface(SolverInterface::class); |
namespace common\logic\Config\TaxRate; | namespace common\logic\Config\TaxRate; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class TaxRateFactory extends BaseService implements FactoryInterface | |||||
class TaxRateBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): TaxRate | |||||
public function instanciate(): TaxRate | |||||
{ | { | ||||
$taxRate = new TaxRate(); | $taxRate = new TaxRate(); | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
TaxRateFactory::class, | |||||
TaxRateBuilder::class, | |||||
TaxRateRepository::class, | TaxRateRepository::class, | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): TaxRateFactory | |||||
public function getBuilder(): TaxRateBuilder | |||||
{ | { | ||||
return new TaxRateFactory(); | |||||
return new TaxRateBuilder(); | |||||
} | } | ||||
public function getRepository(): TaxRateRepository | public function getRepository(): TaxRateRepository |
namespace common\logic\Distribution\ProductDistribution; | namespace common\logic\Distribution\ProductDistribution; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\BuilderInterface; | |||||
use common\logic\Distribution\Distribution\Distribution; | use common\logic\Distribution\Distribution\Distribution; | ||||
use common\logic\Distribution\Distribution\DistributionSolver; | use common\logic\Distribution\Distribution\DistributionSolver; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\Product\Product\Product; | use common\logic\Product\Product\Product; | ||||
class ProductDistributionBuilder extends BaseService implements FactoryInterface | |||||
class ProductDistributionBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
protected ProductDistributionRepository $productDistributionRepository; | protected ProductDistributionRepository $productDistributionRepository; | ||||
protected DistributionSolver $distributionSolver; | protected DistributionSolver $distributionSolver; |
namespace common\logic\Document\DeliveryNote; | namespace common\logic\Document\DeliveryNote; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class DeliveryNoteFactory extends BaseService implements FactoryInterface | |||||
class DeliveryNoteBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): DeliveryNote | |||||
public function instanciate(): DeliveryNote | |||||
{ | { | ||||
$deliveryNote = new DeliveryNote(); | $deliveryNote = new DeliveryNote(); | ||||
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class DeliveryNoteRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
<?php | |||||
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 | |||||
{ | |||||
public function instanciate(): Invoice | |||||
{ | |||||
$invoice = new Invoice(); | |||||
return $invoice; | |||||
} | |||||
} |
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\Document\Document\DocumentBuilder; | use common\logic\Document\Document\DocumentBuilder; | ||||
use common\logic\Document\Document\DocumentSolver; | use common\logic\Document\Document\DocumentSolver; | ||||
use common\logic\PointSale\PointSale\InvoiceRepository; | |||||
class InvoiceContainer implements ContainerInterface | class InvoiceContainer implements ContainerInterface | ||||
{ | { | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
InvoiceFactory::class, | |||||
DocumentSolver::class, | |||||
InvoiceBuilder::class, | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): InvoiceFactory | |||||
public function getSolver(): DocumentSolver | |||||
{ | { | ||||
return new InvoiceFactory(); | |||||
return new DocumentSolver(); | |||||
} | } | ||||
public function getSolver(): DocumentSolver | |||||
public function getRepository(): InvoiceRepository | |||||
{ | { | ||||
return new DocumentSolver(); | |||||
return new InvoiceRepository(); | |||||
} | } | ||||
public function getBuilder(): DocumentBuilder | |||||
public function getBuilder(): InvoiceBuilder | |||||
{ | { | ||||
return new DocumentBuilder(); | |||||
return new InvoiceBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\Document\Invoice; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class InvoiceFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create(): Invoice | |||||
{ | |||||
$invoice = new Invoice(); | |||||
return $invoice; | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class InvoiceRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
namespace common\logic\Document\Quotation; | namespace common\logic\Document\Quotation; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class QuotationFactory extends BaseService implements FactoryInterface | |||||
class QuotationBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): Quotation | |||||
public function instanciate(): Quotation | |||||
{ | { | ||||
$quotation = new Quotation(); | $quotation = new Quotation(); | ||||
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\Document\Document\DocumentBuilder; | use common\logic\Document\Document\DocumentBuilder; | ||||
use common\logic\Document\Document\DocumentSolver; | use common\logic\Document\Document\DocumentSolver; | ||||
use common\logic\Document\Quotation\QuotationBuilder; | |||||
use common\logic\Document\Quotation\QuotationFactory; | use common\logic\Document\Quotation\QuotationFactory; | ||||
use common\logic\Document\Quotation\Quotation; | use common\logic\Document\Quotation\Quotation; | ||||
use common\logic\PointSale\PointSale\QuotationRepository; | |||||
class QuotationContainer implements ContainerInterface | class QuotationContainer implements ContainerInterface | ||||
{ | { | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
QuotationFactory::class, | |||||
QuotationBuilder::class, | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): QuotationFactory | |||||
{ | |||||
return new QuotationFactory(); | |||||
} | |||||
public function getSolver(): DocumentSolver | public function getSolver(): DocumentSolver | ||||
{ | { | ||||
return new DocumentSolver(); | return new DocumentSolver(); | ||||
} | } | ||||
public function getRepository(): QuotationRepository | |||||
{ | |||||
return new QuotationRepository(); | |||||
} | |||||
public function getBuilder(): DocumentBuilder | |||||
public function getBuilder(): QuotationBuilder | |||||
{ | { | ||||
return new DocumentBuilder(); | |||||
return new QuotationBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class QuotationRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
<?php | |||||
namespace common\logic; | |||||
interface FactoryInterface | |||||
{ | |||||
} |
class OrderBuilder extends BaseService implements BuilderInterface | class OrderBuilder extends BaseService implements BuilderInterface | ||||
{ | { | ||||
public function instanciate(): Order | |||||
{ | |||||
$order = new Order(); | |||||
return $order; | |||||
} | |||||
} | } |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
OrderFactory::class, | |||||
OrderSolver::class, | OrderSolver::class, | ||||
OrderRepository::class, | OrderRepository::class, | ||||
OrderBuilder::class, | OrderBuilder::class, | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): OrderFactory | |||||
{ | |||||
return new OrderFactory(); | |||||
} | |||||
public function getSolver(): OrderSolver | public function getSolver(): OrderSolver | ||||
{ | { | ||||
return new OrderSolver(); | return new OrderSolver(); |
<?php | |||||
namespace common\logic\Order\Order; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class OrderFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create(): Order | |||||
{ | |||||
$order = new Order(); | |||||
return $order; | |||||
} | |||||
} |
namespace common\logic\Order\OrderStatusHistory; | namespace common\logic\Order\OrderStatusHistory; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class OrderStatusHistoryFactory extends BaseService implements FactoryInterface | |||||
class OrderStatusHistoryBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): OrderStatusHistory | |||||
public function instanciate(): OrderStatusHistory | |||||
{ | { | ||||
$orderStatusHistory = new OrderStatusHistory(); | $orderStatusHistory = new OrderStatusHistory(); | ||||
namespace common\logic\Order\OrderStatusHistory; | namespace common\logic\Order\OrderStatusHistory; | ||||
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\PointSale\PointSale\OrderStatusHistoryRepository; | |||||
class OrderStatusHistoryContainer implements ContainerInterface | class OrderStatusHistoryContainer implements ContainerInterface | ||||
{ | { | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
OrderStatusHistoryFactory::class | |||||
OrderStatusHistoryRepository::class, | |||||
OrderStatusHistoryBuilder::class | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): OrderStatusHistoryFactory | |||||
public function getRepository(): OrderStatusHistoryRepository | |||||
{ | { | ||||
return new OrderStatusHistoryFactory(); | |||||
return new OrderStatusHistoryRepository(); | |||||
} | |||||
public function getBuilder(): OrderStatusHistoryBuilder | |||||
{ | |||||
return new OrderStatusHistoryBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class OrderStatusHistoryRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
namespace common\logic\Order\ProductOrder; | namespace common\logic\Order\ProductOrder; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class ProductOrderFactory extends BaseService implements FactoryInterface | |||||
class ProductOrderBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): ProductOrder | |||||
public function instanciate(): ProductOrder | |||||
{ | { | ||||
$productOrder = new ProductOrder(); | $productOrder = new ProductOrder(); | ||||
namespace common\logic\Order\ProductOrder; | namespace common\logic\Order\ProductOrder; | ||||
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\PointSale\PointSale\ProductOrderRepository; | |||||
class ProductOrderContainer implements ContainerInterface | class ProductOrderContainer implements ContainerInterface | ||||
{ | { | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProductOrderFactory::class, | |||||
ProductOrderSolver::class, | ProductOrderSolver::class, | ||||
ProductOrderRepository::class, | |||||
ProductOrderBuilder::class, | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProductOrderFactory | |||||
public function getSolver(): ProductOrderSolver | |||||
{ | { | ||||
return new ProductOrderFactory(); | |||||
return new ProductOrderSolver(); | |||||
} | } | ||||
public function getSolver(): ProductOrderSolver | |||||
public function getRepository(): ProductOrderRepository | |||||
{ | { | ||||
return new ProductOrderSolver(); | |||||
return new ProductOrderRepository(); | |||||
} | |||||
public function getBuilder(): ProductOrderBuilder | |||||
{ | |||||
return new ProductOrderBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class ProductOrderRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
class PointSaleBuilder extends BaseService implements BuilderInterface | class PointSaleBuilder extends BaseService implements BuilderInterface | ||||
{ | { | ||||
public function instanciate(): PointSale | |||||
{ | |||||
$pointSale = new PointSale(); | |||||
return $pointSale; | |||||
} | |||||
} | } |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
PointSaleFactory::class, | |||||
PointSaleSolver::class, | PointSaleSolver::class, | ||||
PointSaleRepository::class, | PointSaleRepository::class, | ||||
PointSaleBuilder::class, | PointSaleBuilder::class, | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): PointSaleFactory | |||||
{ | |||||
return new PointSaleFactory(); | |||||
} | |||||
public function getSolver(): PointSaleSolver | public function getSolver(): PointSaleSolver | ||||
{ | { | ||||
return new PointSaleSolver(); | return new PointSaleSolver(); |
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class PointSaleFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create(): PointSale | |||||
{ | |||||
$pointSale = new PointSale(); | |||||
return $pointSale; | |||||
} | |||||
} |
namespace common\logic\PointSale\UserPointSale; | namespace common\logic\PointSale\UserPointSale; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class UserPointSaleFactory extends BaseService implements FactoryInterface | |||||
class UserPointSaleBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): UserPointSale | |||||
public function instanciate(): UserPointSale | |||||
{ | { | ||||
$userPointSale = new UserPointSale(); | $userPointSale = new UserPointSale(); | ||||
namespace common\logic\PointSale\UserPointSale; | namespace common\logic\PointSale\UserPointSale; | ||||
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\PointSale\PointSale\UserPointSaleRepository; | |||||
class UserPointSaleContainer implements ContainerInterface | class UserPointSaleContainer implements ContainerInterface | ||||
{ | { | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
UserPointSaleFactory::class, | |||||
UserPointSaleRepository::class, | |||||
UserPointSaleBuilder::class, | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): UserPointSaleFactory | |||||
public function getRepository(): UserPointSaleRepository | |||||
{ | { | ||||
return new UserPointSaleFactory(); | |||||
return new UserPointSaleRepository(); | |||||
} | |||||
public function getBuilder(): UserPointSaleBuilder | |||||
{ | |||||
return new UserPointSaleBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\PointSale\PointSale; | |||||
use common\logic\BaseService; | |||||
use common\logic\BuilderInterface; | |||||
use common\logic\RepositoryInterface; | |||||
class UserPointSaleRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
$this->producerSolver = $this->loadService(ProducerSolver::class); | $this->producerSolver = $this->loadService(ProducerSolver::class); | ||||
} | } | ||||
public function instanciate(): Producer | |||||
{ | |||||
$producer = new Producer(); | |||||
$producer->order_deadline = Producer::ORDER_DEADLINE_DEFAULT; | |||||
$producer->order_delay = Producer::ORDER_DELAY_DEFAULT; | |||||
return $producer; | |||||
} | |||||
public function init(Producer $producer): void | public function init(Producer $producer): void | ||||
{ | { | ||||
$this->initSlug($producer); | $this->initSlug($producer); |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProducerFactory::class, | |||||
ProducerSolver::class, | ProducerSolver::class, | ||||
ProducerRepository::class, | ProducerRepository::class, | ||||
ProducerBuilder::class, | ProducerBuilder::class, | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProducerFactory | |||||
{ | |||||
return new ProducerFactory(); | |||||
} | |||||
public function getSolver(): ProducerSolver | public function getSolver(): ProducerSolver | ||||
{ | { | ||||
return new ProducerSolver(); | return new ProducerSolver(); |
<?php | |||||
namespace common\logic\Producer\Producer; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class ProducerFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create() | |||||
{ | |||||
$producer = new Producer(); | |||||
$producer->order_deadline = Producer::ORDER_DEADLINE_DEFAULT; | |||||
$producer->order_delay = Producer::ORDER_DELAY_DEFAULT; | |||||
return $producer; | |||||
} | |||||
} |
class ProductBuilder extends BaseService implements BuilderInterface | class ProductBuilder extends BaseService implements BuilderInterface | ||||
{ | { | ||||
public function instanciate(): Product | |||||
{ | |||||
$product = new Product(); | |||||
return $product; | |||||
} | |||||
} | } |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProductFactory::class, | |||||
ProductSolver::class, | ProductSolver::class, | ||||
ProductRepository::class, | |||||
ProductBuilder::class, | ProductBuilder::class, | ||||
ProductRepository::class, | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProductFactory | |||||
{ | |||||
return new ProductFactory(); | |||||
} | |||||
public function getSolver(): ProductSolver | public function getSolver(): ProductSolver | ||||
{ | { | ||||
return new ProductSolver(); | return new ProductSolver(); | ||||
{ | { | ||||
return new ProductBuilder(); | return new ProductBuilder(); | ||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\Product\Product; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class ProductFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create(): Product | |||||
{ | |||||
$product = new Product(); | |||||
return $product; | |||||
} | |||||
} |
namespace common\logic\Product\ProductCategory; | namespace common\logic\Product\ProductCategory; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class ProductCategoryFactory extends BaseService implements FactoryInterface | |||||
class ProductCategoryBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): ProductCategory | |||||
public function instanciate(): ProductCategory | |||||
{ | { | ||||
$productCategory = new ProductCategory(); | $productCategory = new ProductCategory(); | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProductCategoryFactory::class, | |||||
ProductCategoryBuilder::class, | |||||
ProductCategoryRepository::class | ProductCategoryRepository::class | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProductCategoryFactory | |||||
public function getBuilder(): ProductCategoryBuilder | |||||
{ | { | ||||
return new ProductCategoryFactory(); | |||||
return new ProductCategoryBuilder(); | |||||
} | } | ||||
public function getRepository(): ProductCategoryRepository | public function getRepository(): ProductCategoryRepository |
namespace common\logic\Product\ProductPointSale; | namespace common\logic\Product\ProductPointSale; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class ProductPointSaleFactory extends BaseService implements FactoryInterface | |||||
class ProductPointSaleBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): ProductPointSale | |||||
public function instanciate(): ProductPointSale | |||||
{ | { | ||||
$productPointSale = new ProductPointSale(); | $productPointSale = new ProductPointSale(); | ||||
namespace common\logic\Product\ProductPointSale; | namespace common\logic\Product\ProductPointSale; | ||||
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\Product\ProductPrice\ProductPointSaleRepository; | |||||
class ProductPointSaleContainer implements ContainerInterface | class ProductPointSaleContainer implements ContainerInterface | ||||
{ | { | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProductPointSaleFactory::class, | |||||
ProductPointSaleRepository::class, | |||||
ProductPointSaleBuilder::class, | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProductPointSaleFactory | |||||
public function getRepository(): ProductPointSaleRepository | |||||
{ | { | ||||
return new ProductPointSaleFactory(); | |||||
return new ProductPointSaleRepository(); | |||||
} | |||||
public function getBuilder(): ProductPointSaleBuilder | |||||
{ | |||||
return new ProductPointSaleBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\Product\ProductPrice; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class ProductPointSaleRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |
namespace common\logic\Product\ProductPrice; | namespace common\logic\Product\ProductPrice; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class ProductPriceFactory extends BaseService implements FactoryInterface | |||||
class ProductPriceBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): ProductPrice | |||||
public function instanciate(): ProductPrice | |||||
{ | { | ||||
$productPrice = new ProductPrice(); | $productPrice = new ProductPrice(); | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProductPriceFactory::class, | |||||
ProductPriceSolver::class, | ProductPriceSolver::class, | ||||
ProductPriceRepository::class | ProductPriceRepository::class | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProductPriceFactory | |||||
public function getBuilder(): ProductPriceBuilder | |||||
{ | { | ||||
return new ProductPriceFactory(); | |||||
return new ProductPriceBuilder(); | |||||
} | } | ||||
public function getSolver(): ProductPriceSolver | public function getSolver(): ProductPriceSolver |
namespace common\logic\Subscription\ProductSubscription; | namespace common\logic\Subscription\ProductSubscription; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class ProductSubscriptionFactory extends BaseService implements FactoryInterface | |||||
class ProductSubscriptionBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create(): ProductSubscription | |||||
public function instanciate(): ProductSubscription | |||||
{ | { | ||||
$productSubscription = new ProductSubscription(); | $productSubscription = new ProductSubscription(); | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
ProductSubscriptionFactory::class | |||||
ProductSubscriptionBuilder::class | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): ProductSubscriptionFactory | |||||
public function getFactory(): ProductSubscriptionBuilder | |||||
{ | { | ||||
return new ProductSubscriptionFactory(); | |||||
return new ProductSubscriptionBuilder(); | |||||
} | } | ||||
} | } |
class SubscriptionBuilder extends BaseService implements BuilderInterface | class SubscriptionBuilder extends BaseService implements BuilderInterface | ||||
{ | { | ||||
public function instanciate(): Subscription | |||||
{ | |||||
$subscription = new Subscription(); | |||||
return $subscription; | |||||
} | |||||
} | } |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
SubscriptionFactory::class, | |||||
SubscriptionSolver::class, | SubscriptionSolver::class, | ||||
SubscriptionRepository::class, | SubscriptionRepository::class, | ||||
SubscriptionBuilder::class | SubscriptionBuilder::class | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): SubscriptionFactory | |||||
{ | |||||
return new SubscriptionFactory(); | |||||
} | |||||
public function getSolver(): SubscriptionSolver | public function getSolver(): SubscriptionSolver | ||||
{ | { | ||||
return new SubscriptionSolver(); | return new SubscriptionSolver(); |
<?php | |||||
namespace common\logic\Subscription\Subscription; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class SubscriptionFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create(): Subscription | |||||
{ | |||||
$subscription = new Subscription(); | |||||
return $subscription; | |||||
} | |||||
} |
$this->userProducerBuilder = $this->loadService(UserProducerBuilder::class); | $this->userProducerBuilder = $this->loadService(UserProducerBuilder::class); | ||||
} | } | ||||
public function instanciate(): CreditHistory | |||||
{ | |||||
$creditHistory = new CreditHistory(); | |||||
return $creditHistory; | |||||
} | |||||
public function save(CreditHistory $creditHistory): bool | public function save(CreditHistory $creditHistory): bool | ||||
{ | { | ||||
if ($creditHistory->getAmount() > -0.01 && $creditHistory->getAmount() < 0.01) { | if ($creditHistory->getAmount() > -0.01 && $creditHistory->getAmount() < 0.01) { |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
CreditHistoryFactory::class, | |||||
CreditHistorySolver::class, | CreditHistorySolver::class, | ||||
CreditHistoryBuilder::class, | CreditHistoryBuilder::class, | ||||
CreditHistoryRepository::class, | CreditHistoryRepository::class, | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): CreditHistoryFactory | |||||
{ | |||||
return new CreditHistoryFactory(); | |||||
} | |||||
public function getSolver(): CreditHistorySolver | public function getSolver(): CreditHistorySolver | ||||
{ | { | ||||
return new CreditHistorySolver(); | return new CreditHistorySolver(); |
<?php | |||||
namespace common\logic\User\CreditHistory; | |||||
use common\logic\FactoryInterface; | |||||
class CreditHistoryFactory implements FactoryInterface | |||||
{ | |||||
public function create() | |||||
{ | |||||
$creditHistory = new CreditHistory(); | |||||
return $creditHistory; | |||||
} | |||||
} |
class UserBuilder extends BaseService implements BuilderInterface | class UserBuilder extends BaseService implements BuilderInterface | ||||
{ | { | ||||
public function instanciate(): User | |||||
{ | |||||
$user = new User(); | |||||
return $user; | |||||
} | |||||
public function initPassword(User $user, string $password) | public function initPassword(User $user, string $password) | ||||
{ | { | ||||
$user->setPassword($password); | $user->setPassword($password); |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
UserFactory::class, | |||||
UserSolver::class, | UserSolver::class, | ||||
UserRepository::class, | UserRepository::class, | ||||
UserBuilder::class, | UserBuilder::class, | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): UserFactory | |||||
{ | |||||
return new UserFactory(); | |||||
} | |||||
public function getSolver(): UserSolver | public function getSolver(): UserSolver | ||||
{ | { | ||||
return new UserSolver(); | return new UserSolver(); |
<?php | |||||
namespace common\logic\User\User; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class UserFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create() | |||||
{ | |||||
$user = new User(); | |||||
return $user; | |||||
} | |||||
} |
namespace common\logic\User\UserGroup; | namespace common\logic\User\UserGroup; | ||||
use common\logic\BaseService; | use common\logic\BaseService; | ||||
use common\logic\FactoryInterface; | |||||
use common\logic\BuilderInterface; | |||||
class UserGroupFactory extends BaseService implements FactoryInterface | |||||
class UserGroupBuilder extends BaseService implements BuilderInterface | |||||
{ | { | ||||
public function create() | |||||
public function instanciate(): UserGroup | |||||
{ | { | ||||
$userGroup = new UserGroup(); | $userGroup = new UserGroup(); | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
UserGroupFactory::class, | |||||
UserGroupBuilder::class, | |||||
UserGroupRepository::class | UserGroupRepository::class | ||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): UserGroupFactory | |||||
public function getFactory(): UserGroupBuilder | |||||
{ | { | ||||
return new UserGroupFactory(); | |||||
return new UserGroupBuilder(); | |||||
} | } | ||||
public function getRepository(): UserGroupRepository | public function getRepository(): UserGroupRepository |
$this->userProducerRepository = $this->loadService(UserProducerRepository::class); | $this->userProducerRepository = $this->loadService(UserProducerRepository::class); | ||||
} | } | ||||
public function instanciate(int $idUser, int $idProducer, int $bookmark = 1) | |||||
{ | |||||
$userProducer = new UserProducer(); | |||||
$userProducer->setIdUser($idUser); | |||||
$userProducer->setIdProducer($idProducer); | |||||
$userProducer->setCredit(0); | |||||
$userProducer->setActive(1); | |||||
$userProducer->setBookmark($bookmark); | |||||
return $userProducer; | |||||
} | |||||
public function updateCredit(CreditHistory $creditHistory): void | public function updateCredit(CreditHistory $creditHistory): void | ||||
{ | { | ||||
$userProducer = $this->userProducerRepository->getOne($creditHistory->getIdUser(), $creditHistory->getIdProducer()); | $userProducer = $this->userProducerRepository->getOne($creditHistory->getIdUser(), $creditHistory->getIdProducer()); |
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
UserProducerRepository::class | |||||
UserProducerRepository::class, | |||||
UserProducerBuilder::class, | |||||
]; | ]; | ||||
} | } | ||||
{ | { | ||||
return new UserProducerRepository(); | return new UserProducerRepository(); | ||||
} | } | ||||
public function getBuilder(): UserProducerBuilder | |||||
{ | |||||
return new UserProducerBuilder(); | |||||
} | |||||
} | } |
<?php | |||||
namespace common\logic\User\UserProducer; | |||||
use common\logic\FactoryInterface; | |||||
class UserProducerFactory implements FactoryInterface | |||||
{ | |||||
public function create(int $idUser, int $idProducer, int $bookmark = 1) | |||||
{ | |||||
$userProducer = new UserProducer(); | |||||
$userProducer->setIdUser($idUser); | |||||
$userProducer->setIdProducer($idProducer); | |||||
$userProducer->setCredit(0); | |||||
$userProducer->setActive(1); | |||||
$userProducer->setBookmark($bookmark); | |||||
return $userProducer; | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\User\UserGroup; | |||||
use common\logic\BaseService; | |||||
use common\logic\BuilderInterface; | |||||
class UserUserGroupBuilder extends BaseService implements BuilderInterface | |||||
{ | |||||
public function instanciate(): UserUserGroup | |||||
{ | |||||
$userUserGroup = new UserUserGroup(); | |||||
return $userUserGroup; | |||||
} | |||||
} |
namespace common\logic\User\UserGroup; | namespace common\logic\User\UserGroup; | ||||
use common\logic\ContainerInterface; | use common\logic\ContainerInterface; | ||||
use common\logic\User\UserProducer\UserUserGroupRepository; | |||||
class UserUserGroupContainer implements ContainerInterface | class UserUserGroupContainer implements ContainerInterface | ||||
{ | { | ||||
public function getEntityFqcn(): string | public function getEntityFqcn(): string | ||||
{ | { | ||||
return User UserGroup::class; | |||||
return UserUserGroup::class; | |||||
} | } | ||||
public function getServices(): array | public function getServices(): array | ||||
{ | { | ||||
return [ | return [ | ||||
UserUserGroupFactory::class | |||||
UserUserGroupRepository::class, | |||||
UserUserGroupBuilder::class | |||||
]; | ]; | ||||
} | } | ||||
public function getFactory(): UserUserGroupFactory | |||||
public function getRepository(): UserUserGroupRepository | |||||
{ | { | ||||
return new UserUserGroupFactory(); | |||||
return new UserUserGroupRepository(); | |||||
} | |||||
public function getBuilder(): UserUserGroupBuilder | |||||
{ | |||||
return new UserUserGroupBuilder(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\User\UserGroup; | |||||
use common\logic\BaseService; | |||||
use common\logic\FactoryInterface; | |||||
class UserUserGroupFactory extends BaseService implements FactoryInterface | |||||
{ | |||||
public function create(): User UserGroup | |||||
{ | |||||
$userUserGroup = new User UserGroup(); | |||||
return $userUserGroup; | |||||
} | |||||
} |
<?php | |||||
namespace common\logic\User\UserProducer; | |||||
use common\logic\BaseService; | |||||
use common\logic\RepositoryInterface; | |||||
class UserUserGroupRepository extends BaseService implements RepositoryInterface | |||||
{ | |||||
} |