@@ -4,5 +4,8 @@ namespace common\logic; | |||
abstract class AbstractContainer extends AbstractSingleton implements ContainerInterface | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return $this->getDefinition()->getEntityFqcn(); | |||
} | |||
} |
@@ -9,14 +9,17 @@ abstract class AbstractRepository extends AbstractService implements RepositoryI | |||
const ORDER_BY = 'orderby'; | |||
const ATTRIBUTE_ID_PRODUCER = 'attribute_id_producer'; | |||
public function createQuery() | |||
public function loadQuery(string $serviceClass) | |||
{ | |||
$this->repositoryQuery->createQuery(); | |||
$this->query = $this->loadService($serviceClass); | |||
} | |||
return $this->repositoryQuery; | |||
public function createQuery() | |||
{ | |||
return $this->query->createQuery(); | |||
} | |||
public function createDefaultQuery() | |||
public function createDefaultQuery(): RepositoryQueryInterface | |||
{ | |||
$this->createQuery(); | |||
@@ -24,24 +27,24 @@ abstract class AbstractRepository extends AbstractService implements RepositoryI | |||
// with | |||
if (is_array($defaultOptions['with']) && count($defaultOptions['with'])) { | |||
$this->repositoryQuery->with($defaultOptions['with']); | |||
$this->query->with($defaultOptions['with']); | |||
} | |||
// join with | |||
if (is_array($defaultOptions['join_with']) && count($defaultOptions['join_with'])) { | |||
$this->repositoryQuery->joinWith($defaultOptions['join_with']); | |||
$this->query->joinWith($defaultOptions['join_with']); | |||
} | |||
// id producer contexte | |||
if(isset($defaultOptions['attribute_id_producer']) && $defaultOptions['attribute_id_producer']) { | |||
$this->repositoryQuery->andWhere([$defaultOptions['attribute_id_producer'] => $this->getProducerContextId()]); | |||
$this->query->andWhere([$defaultOptions['attribute_id_producer'] => $this->getProducerContextId()]); | |||
} | |||
// order by | |||
if(isset($defaultOptions['orderby']) && $defaultOptions['orderby']) { | |||
$this->repositoryQuery->orderBy($defaultOptions['orderby']); | |||
$this->query->orderBy($defaultOptions['orderby']); | |||
} | |||
return $this->repositoryQuery; | |||
return $this->query; | |||
} | |||
} |
@@ -3,12 +3,23 @@ | |||
namespace common\logic; | |||
use common\components\ActiveRecordCommon; | |||
use common\logic\Distribution\Distribution\Service\DistributionDefinition; | |||
use yii\db\ActiveQuery; | |||
abstract class AbstractRepositoryQuery extends AbstractService implements RepositoryQueryInterface | |||
{ | |||
protected ActiveQuery $query; | |||
protected DefinitionInterface $definition; | |||
public function loadDefinition(string $serviceClass): void | |||
{ | |||
$this->definition = $this->loadService($serviceClass); | |||
} | |||
public function baseQuery(): ActiveQuery | |||
{ | |||
$class = $this->definition->getEntityFqcn(); | |||
return $class::find(); | |||
} | |||
public function createQuery(): self | |||
{ |
@@ -4,15 +4,14 @@ namespace common\logic\Config\TaxRate\Repository; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Config\TaxRate\Model\TaxRate; | |||
use yii\db\ActiveQuery; | |||
class TaxRateRepository extends AbstractRepository | |||
{ | |||
protected TaxRateRepositoryQuery $repositoryQuery; | |||
protected TaxRateRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->repositoryQuery = $this->loadService(TaxRateRepositoryQuery::class); | |||
$this->loadQuery(TaxRateRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array | |||
@@ -22,20 +21,20 @@ class TaxRateRepository extends AbstractRepository | |||
self::JOIN_WITH => [], | |||
self::ORDER_BY => 'pourcent ASC', | |||
self::ATTRIBUTE_ID_PRODUCER => '' | |||
] ; | |||
]; | |||
} | |||
public function findOneTaxRateById(int $id): ?TaxRate | |||
{ | |||
$query = $this->createQuery(); | |||
$query->filterById($id); | |||
return $query->findOne(); | |||
return $this->createQuery() | |||
->filterById($id) | |||
->findOne(); | |||
} | |||
public function findTaxRates(): array | |||
{ | |||
$query = $this->createQuery(); | |||
return $query->find(); | |||
return $this->createQuery() | |||
->find(); | |||
} | |||
public function findTaxRatesAsArray(): array | |||
@@ -43,7 +42,7 @@ class TaxRateRepository extends AbstractRepository | |||
$taxRateArrayReturn = []; | |||
$taxRateArray = $this->findTaxRates(); | |||
foreach($taxRateArray as $taxRate) { | |||
foreach ($taxRateArray as $taxRate) { | |||
$taxRateArrayReturn[$taxRate->id] = $taxRate; | |||
} | |||
@@ -3,13 +3,14 @@ | |||
namespace common\logic\Config\TaxRate\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Config\TaxRate\Model\TaxRate; | |||
use yii\db\ActiveQuery; | |||
use common\logic\Config\TaxRate\Service\TaxRateDefinition; | |||
class TaxRateRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected TaxRateDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return TaxRate::find(); | |||
$this->loadDefinition(TaxRateDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Config\TaxRate\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Config\TaxRate\Model\TaxRate; | |||
class TaxRateDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return TaxRate::class; | |||
} | |||
} |
@@ -3,25 +3,26 @@ | |||
namespace common\logic\Config\TaxRate\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Config\TaxRate\Model\TaxRate; | |||
use common\logic\Config\TaxRate\Repository\TaxRateRepository; | |||
use common\logic\Config\TaxRate\Service\TaxRateBuilder; | |||
use common\logic\Config\TaxRate\Service\TaxRateDefinition; | |||
class TaxRateContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return TaxRate::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
TaxRateDefinition::class, | |||
TaxRateBuilder::class, | |||
TaxRateRepository::class, | |||
]; | |||
} | |||
public function getDefinition(): TaxRateDefinition | |||
{ | |||
return TaxRateDefinition::getInstance(); | |||
} | |||
public function getBuilder(): TaxRateBuilder | |||
{ | |||
return TaxRateBuilder::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Config\TaxRate\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Config\TaxRate\Repository\TaxRateRepository; | |||
use common\logic\Config\TaxRate\Service\TaxRateBuilder; | |||
use common\logic\Config\TaxRate\Service\TaxRateDefinition; | |||
/** | |||
* @mixin TaxRateDefinition | |||
* @mixin TaxRateRepository | |||
* @mixin TaxRateBuilder | |||
*/ |
@@ -4,6 +4,6 @@ namespace common\logic; | |||
interface ContainerInterface | |||
{ | |||
public function getEntityFqcn(): string; | |||
public function getServices(): array; | |||
public function getDefinition(): DefinitionInterface; | |||
} |
@@ -4,5 +4,5 @@ namespace common\logic; | |||
interface DefinitionInterface | |||
{ | |||
public function getEntityFqcn(): string; | |||
} |
@@ -5,18 +5,19 @@ namespace common\logic\Distribution\Distribution\Repository; | |||
use common\logic\AbstractRepository; | |||
use common\logic\Distribution\Distribution\Model\Distribution; | |||
use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||
use common\logic\RepositoryQueryInterface; | |||
use common\logic\Subscription\Subscription\Model\Subscription; | |||
use common\logic\Subscription\Subscription\Service\SubscriptionSolver; | |||
class DistributionRepository extends AbstractRepository | |||
{ | |||
protected DistributionRepositoryQuery $repositoryQuery; | |||
protected DistributionRepositoryQuery $query; | |||
protected DistributionSolver $distributionSolver; | |||
protected SubscriptionSolver $subscriptionSolver; | |||
public function loadDependencies(): void | |||
{ | |||
$this->repositoryQuery = $this->loadService(DistributionRepositoryQuery::class); | |||
$this->loadQuery(DistributionRepositoryQuery::class); | |||
$this->distributionSolver = $this->loadService(DistributionSolver::class); | |||
$this->subscriptionSolver = $this->loadService(SubscriptionSolver::class); | |||
} |
@@ -3,22 +3,16 @@ | |||
namespace common\logic\Distribution\Distribution\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Distribution\Distribution\Model\Distribution; | |||
use common\logic\Distribution\Distribution\Service\DistributionDefinition; | |||
use common\logic\Subscription\Subscription\Model\Subscription; | |||
use yii\db\ActiveQuery; | |||
class DistributionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function loadDependencies(): void | |||
{ | |||
$this->definition = $this->loadService(DistributionDefinition::class); | |||
} | |||
protected DistributionDefinition $definition; | |||
public function baseQuery(): ActiveQuery | |||
public function loadDependencies(): void | |||
{ | |||
$class = $this->definition->getEntityFqcn(); | |||
return $class::find(); | |||
$this->loadDefinition(DistributionDefinition::class); | |||
} | |||
public function filterByDate(string $date): self |
@@ -3,7 +3,6 @@ | |||
namespace common\logic\Distribution\Distribution\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Distribution\Distribution\Model\Distribution; | |||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||
use common\logic\Distribution\Distribution\Service\DistributionBuilder; | |||
use common\logic\Distribution\Distribution\Service\DistributionDefinition; | |||
@@ -11,11 +10,6 @@ use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||
class DistributionContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return $this->getDefinition()->getEntityFqcn(); | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ |
@@ -5,9 +5,11 @@ namespace common\logic\Distribution\Distribution\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Distribution\Distribution\Repository\DistributionRepository; | |||
use common\logic\Distribution\Distribution\Service\DistributionBuilder; | |||
use common\logic\Distribution\Distribution\Service\DistributionDefinition; | |||
use common\logic\Distribution\Distribution\Service\DistributionSolver; | |||
/** | |||
* @mixin DistributionDefinition | |||
* @mixin DistributionSolver | |||
* @mixin DistributionRepository | |||
* @mixin DistributionBuilder |
@@ -9,11 +9,11 @@ use common\logic\PointSale\PointSale\Model\PointSale; | |||
class PointSaleDistributionRepository extends AbstractRepository | |||
{ | |||
protected PointSaleDistributionRepositoryQuery $repositoryQuery; | |||
protected PointSaleDistributionRepositoryQuery $query; | |||
public function loadDependencies(): void | |||
{ | |||
$this->repositoryQuery = $this->loadService(PointSaleDistributionRepositoryQuery::class); | |||
$this->loadQuery(PointSaleDistributionRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -10,15 +10,11 @@ use yii\db\ActiveQuery; | |||
class PointSaleDistributionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function loadDependencies(): void | |||
{ | |||
$this->definition = $this->loadService(PointSaleDistributionDefinition::class); | |||
} | |||
protected PointSaleDistributionDefinition $definition; | |||
public function baseQuery(): ActiveQuery | |||
public function loadDependencies(): void | |||
{ | |||
$class = $this->definition->getEntityFqcn(); | |||
return $class::find(); | |||
$this->loadDefinition(PointSaleDistributionDefinition::class); | |||
} | |||
public function filterByDistribution(Distribution $distribution): self |
@@ -9,11 +9,6 @@ use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributio | |||
class PointSaleDistributionContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return $this->getDefinition()->getEntityFqcn(); | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ |
@@ -5,8 +5,10 @@ namespace common\logic\Distribution\PointSaleDistribution\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; | |||
use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionBuilder; | |||
use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionDefinition; | |||
/** | |||
* @mixin PointSaleDistributionDefinition | |||
* @mixin PointSaleDistributionRepository | |||
* @mixin PointSaleDistributionBuilder | |||
*/ |
@@ -13,7 +13,7 @@ class ProductDistributionRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductDistributionRepositoryQuery::class); | |||
$this->loadQuery(ProductDistributionRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Distribution\ProductDistribution\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProductDistributionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductDistributionDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProductDistribution::find(); | |||
$this->loadDefinition(ProductDistributionDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Distribution\ProductDistribution\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||
class ProductDistributionDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductDistribution::class; | |||
} | |||
} |
@@ -6,22 +6,24 @@ use common\logic\AbstractContainer; | |||
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; | |||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder; | |||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionDefinition; | |||
class ProductDistributionContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductDistribution::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProductDistributionDefinition::class, | |||
ProductDistributionRepository::class, | |||
ProductDistributionBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): ProductDistributionDefinition | |||
{ | |||
return ProductDistributionDefinition::getInstance(); | |||
} | |||
public function getRepository(): ProductDistributionRepository | |||
{ | |||
return ProductDistributionRepository::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Distribution\ProductDistribution\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; | |||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder; | |||
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionDefinition; | |||
/** | |||
* @mixin ProductDistributionDefinition | |||
* @mixin ProductDistributionRepository | |||
* @mixin ProductDistributionBuilder | |||
*/ |
@@ -11,7 +11,7 @@ class DeliveryNoteRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(DeliveryNoteRepositoryQuery::class); | |||
$this->loadQuery(DeliveryNoteRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Document\DeliveryNote\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteDefinition; | |||
use yii\db\ActiveQuery; | |||
class DeliveryNoteRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected DeliveryNoteDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return DeliveryNote::find(); | |||
$this->loadDefinition(DeliveryNoteDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Document\DeliveryNote\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||
class DeliveryNoteDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return DeliveryNote::class; | |||
} | |||
} |
@@ -3,27 +3,28 @@ | |||
namespace common\logic\Document\DeliveryNote\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Document\DeliveryNote\Model\DeliveryNote; | |||
use common\logic\Document\DeliveryNote\Repository\DeliveryNoteRepository; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteBuilder; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteDefinition; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteSolver; | |||
class DeliveryNoteContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return DeliveryNote::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
DeliveryNoteDefinition::class, | |||
DeliveryNoteSolver::class, | |||
DeliveryNoteRepository::class, | |||
DeliveryNoteBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): DeliveryNoteDefinition | |||
{ | |||
return DeliveryNoteDefinition::getInstance(); | |||
} | |||
public function getSolver(): DeliveryNoteSolver | |||
{ | |||
return DeliveryNoteSolver::getInstance(); |
@@ -4,10 +4,12 @@ namespace common\logic\Document\DeliveryNote\Wrapper; | |||
use common\logic\Document\DeliveryNote\Repository\DeliveryNoteRepository; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteBuilder; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteDefinition; | |||
use common\logic\Document\DeliveryNote\Service\DeliveryNoteSolver; | |||
use common\logic\Document\Document\Wrapper\DocumentManager; | |||
/** | |||
* @mixin DeliveryNoteDefinition | |||
* @mixin DeliveryNoteSolver | |||
* @mixin DeliveryNoteRepository | |||
* @mixin DeliveryNoteBuilder |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Document\Document\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Document\Document\Model\Document; | |||
class DocumentDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Document::class; | |||
} | |||
} |
@@ -3,22 +3,19 @@ | |||
namespace common\logic\Document\Document\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Document\Document\Model\Document; | |||
use common\logic\DefinitionInterface; | |||
use common\logic\Document\Document\Repository\DocumentRepository; | |||
use common\logic\Document\Document\Service\DocumentBuilder; | |||
use common\logic\Document\Document\Service\DocumentDefinition; | |||
use common\logic\Document\Document\Service\DocumentSolver; | |||
use common\logic\Document\Document\Service\DocumentUtils; | |||
class DocumentContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Document::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
DocumentDefinition::class, | |||
DocumentSolver::class, | |||
DocumentRepository::class, | |||
DocumentBuilder::class, | |||
@@ -26,6 +23,11 @@ class DocumentContainer extends AbstractContainer | |||
]; | |||
} | |||
public function getDefinition(): DefinitionInterface | |||
{ | |||
return DocumentDefinition::getInstance(); | |||
} | |||
public function getSolver(): DocumentSolver | |||
{ | |||
return DocumentSolver::getInstance(); |
@@ -4,10 +4,12 @@ namespace common\logic\Document\Document\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Document\Document\Service\DocumentBuilder; | |||
use common\logic\Document\Document\Service\DocumentDefinition; | |||
use common\logic\Document\Document\Service\DocumentSolver; | |||
use common\logic\Document\Document\Service\DocumentUtils; | |||
/** | |||
* @mixin DocumentDefinition | |||
* @mixin DocumentSolver | |||
* @mixin DocumentBuilder | |||
* @mixin DocumentUtils |
@@ -11,7 +11,7 @@ class InvoiceRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(InvoiceRepositoryQuery::class); | |||
$this->loadQuery(InvoiceRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -3,13 +3,14 @@ | |||
namespace common\logic\Document\Invoice\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Document\Invoice\Model\Invoice; | |||
use yii\db\ActiveQuery; | |||
use common\logic\Document\Invoice\Service\InvoiceDefinition; | |||
class InvoiceRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected InvoiceDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return Invoice::find(); | |||
$this->loadDefinition(InvoiceDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Document\Invoice\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Document\Invoice\Model\Invoice; | |||
class InvoiceDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Invoice::class; | |||
} | |||
} |
@@ -4,26 +4,27 @@ namespace common\logic\Document\Invoice\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Document\Document\Service\DocumentSolver; | |||
use common\logic\Document\Invoice\Model\Invoice; | |||
use common\logic\Document\Invoice\Repository\InvoiceRepository; | |||
use common\logic\Document\Invoice\Service\InvoiceBuilder; | |||
use common\logic\Document\Invoice\Service\InvoiceDefinition; | |||
class InvoiceContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Invoice::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
InvoiceDefinition::class, | |||
DocumentSolver::class, | |||
InvoiceRepository::class, | |||
InvoiceBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): InvoiceDefinition | |||
{ | |||
return InvoiceDefinition::getInstance(); | |||
} | |||
public function getSolver(): DocumentSolver | |||
{ | |||
return DocumentSolver::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Document\Invoice\Wrapper; | |||
use common\logic\Document\Document\Wrapper\DocumentManager; | |||
use common\logic\Document\Invoice\Repository\InvoiceRepository; | |||
use common\logic\Document\Invoice\Service\InvoiceBuilder; | |||
use common\logic\Document\Invoice\Service\InvoiceDefinition; | |||
/** | |||
* @mixin InvoiceDefinition | |||
* @mixin InvoiceRepository | |||
* @mixin InvoiceBuilder | |||
*/ |
@@ -11,7 +11,7 @@ class QuotationRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(QuotationRepositoryQuery::class); | |||
$this->loadQuery(QuotationRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Document\Quotation\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Document\Quotation\Model\Quotation; | |||
use common\logic\Document\Quotation\Service\QuotationDefinition; | |||
use yii\db\ActiveQuery; | |||
class QuotationRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected QuotationDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return Quotation::find(); | |||
$this->loadDefinition(QuotationDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Document\Quotation\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Document\Quotation\Model\Quotation; | |||
class QuotationDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Quotation::class; | |||
} | |||
} |
@@ -4,26 +4,27 @@ namespace common\logic\Document\Quotation\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Document\Document\Service\DocumentSolver; | |||
use common\logic\Document\Quotation\Model\Quotation; | |||
use common\logic\Document\Quotation\Repository\QuotationRepository; | |||
use common\logic\Document\Quotation\Service\QuotationBuilder; | |||
use common\logic\Document\Quotation\Service\QuotationDefinition; | |||
class QuotationContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Quotation::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
QuotationDefinition::class, | |||
DocumentSolver::class, | |||
QuotationRepository::class, | |||
QuotationBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): QuotationDefinition | |||
{ | |||
return QuotationDefinition::getInstance(); | |||
} | |||
public function getSolver(): DocumentSolver | |||
{ | |||
return DocumentSolver::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Document\Quotation\Wrapper; | |||
use common\logic\Document\Document\Wrapper\DocumentManager; | |||
use common\logic\Document\Quotation\Repository\QuotationRepository; | |||
use common\logic\Document\Quotation\Service\QuotationBuilder; | |||
use common\logic\Document\Quotation\Service\QuotationDefinition; | |||
/** | |||
* @mixin QuotationDefinition | |||
* @mixin QuotationRepository | |||
* @mixin QuotationBuilder | |||
*/ |
@@ -30,7 +30,7 @@ class OrderRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(OrderRepositoryQuery::class); | |||
$this->loadQuery(OrderRepositoryQuery::class); | |||
$this->productOrderRepository = $this->loadService(ProductOrderRepository::class); | |||
$this->producerRepository = $this->loadService(ProducerRepository::class); | |||
$this->orderSolver = $this->loadService(OrderSolver::class); |
@@ -3,13 +3,14 @@ | |||
namespace common\logic\Order\Order\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Order\Order\Model\Order; | |||
use yii\db\ActiveQuery; | |||
use common\logic\Order\Order\Service\OrderDefinition; | |||
class OrderRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected OrderDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return Order::find(); | |||
$this->loadDefinition(OrderDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Order\Order\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Order\Order\Model\Order; | |||
class OrderDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Order::class; | |||
} | |||
} |
@@ -3,22 +3,18 @@ | |||
namespace common\logic\Order\Order\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Order\Order\Model\Order; | |||
use common\logic\Order\Order\Repository\OrderRepository; | |||
use common\logic\Order\Order\Service\OrderBuilder; | |||
use common\logic\Order\Order\Service\OrderDefinition; | |||
use common\logic\Order\Order\Service\OrderSolver; | |||
use common\logic\Order\Order\Service\OrderUtils; | |||
class OrderContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Order::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
OrderDefinition::class, | |||
OrderSolver::class, | |||
OrderRepository::class, | |||
OrderBuilder::class, | |||
@@ -26,6 +22,11 @@ class OrderContainer extends AbstractContainer | |||
]; | |||
} | |||
public function getDefinition(): OrderDefinition | |||
{ | |||
return OrderDefinition::getInstance(); | |||
} | |||
public function getSolver(): OrderSolver | |||
{ | |||
return OrderSolver::getInstance(); |
@@ -5,9 +5,11 @@ namespace common\logic\Order\Order\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Order\Order\Repository\OrderRepository; | |||
use common\logic\Order\Order\Service\OrderBuilder; | |||
use common\logic\Order\Order\Service\OrderDefinition; | |||
use common\logic\Order\Order\Service\OrderSolver; | |||
/** | |||
* @mixin OrderDefinition | |||
* @mixin OrderSolver | |||
* @mixin OrderRepository | |||
* @mixin OrderBuilder |
@@ -10,7 +10,7 @@ class OrderStatusHistoryRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(OrderStatusHistoryRepositoryQuery::class); | |||
$this->loadQuery(OrderStatusHistoryRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Order\OrderStatusHistory\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Order\OrderStatusHistory\Model\OrderStatusHistory; | |||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryDefinition; | |||
use yii\db\ActiveQuery; | |||
class OrderStatusHistoryRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected OrderStatusHistoryDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return OrderStatusHistory::find(); | |||
$this->loadDefinition(OrderStatusHistoryDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Order\OrderStatusHistory\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Order\OrderStatusHistory\Model\OrderStatusHistory; | |||
class OrderStatusHistoryDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return OrderStatusHistory::class; | |||
} | |||
} |
@@ -3,25 +3,26 @@ | |||
namespace common\logic\Order\OrderStatusHistory\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Order\OrderStatusHistory\Model\OrderStatusHistory; | |||
use common\logic\Order\OrderStatusHistory\Repository\OrderStatusHistoryRepository; | |||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryBuilder; | |||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryDefinition; | |||
class OrderStatusHistoryContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return OrderStatusHistory::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
OrderStatusHistoryDefinition::class, | |||
OrderStatusHistoryRepository::class, | |||
OrderStatusHistoryBuilder::class | |||
]; | |||
} | |||
public function getDefinition(): OrderStatusHistoryDefinition | |||
{ | |||
return OrderStatusHistoryDefinition::getInstance(); | |||
} | |||
public function getRepository(): OrderStatusHistoryRepository | |||
{ | |||
return OrderStatusHistoryRepository::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Order\OrderStatusHistory\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Order\OrderStatusHistory\Repository\OrderStatusHistoryRepository; | |||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryBuilder; | |||
use common\logic\Order\OrderStatusHistory\Service\OrderStatusHistoryDefinition; | |||
/** | |||
* @mixin OrderStatusHistoryDefinition | |||
* @mixin OrderStatusHistoryRepository | |||
* @mixin OrderStatusHistoryBuilder | |||
*/ |
@@ -12,7 +12,7 @@ class ProductOrderRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductOrderRepositoryQuery::class); | |||
$this->loadQuery(ProductOrderRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Order\ProductOrder\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProductOrderRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductOrderDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProductOrder::find(); | |||
$this->loadDefinition(ProductOrderDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Order\ProductOrder\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||
class ProductOrderDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductOrder::class; | |||
} | |||
} |
@@ -3,27 +3,28 @@ | |||
namespace common\logic\Order\ProductOrder\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Order\ProductOrder\Model\ProductOrder; | |||
use common\logic\Order\ProductOrder\Repository\ProductOrderRepository; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderBuilder; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderDefinition; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderSolver; | |||
class ProductOrderContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductOrder::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProductOrderDefinition::class, | |||
ProductOrderSolver::class, | |||
ProductOrderRepository::class, | |||
ProductOrderBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): ProductOrderDefinition | |||
{ | |||
return ProductOrderDefinition::getInstance(); | |||
} | |||
public function getSolver(): ProductOrderSolver | |||
{ | |||
return ProductOrderSolver::getInstance(); |
@@ -5,9 +5,11 @@ namespace common\logic\Order\ProductOrder\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Order\ProductOrder\Repository\ProductOrderRepository; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderBuilder; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderDefinition; | |||
use common\logic\Order\ProductOrder\Service\ProductOrderSolver; | |||
/** | |||
* @mixin ProductOrderDefinition | |||
* @mixin ProductOrderSolver | |||
* @mixin ProductOrderRepository | |||
* @mixin ProductOrderBuilder |
@@ -15,7 +15,7 @@ class PointSaleRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(PointSaleRepositoryQuery::class); | |||
$this->loadQuery(PointSaleRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\PointSale\PointSale\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\PointSale\PointSale\Model\PointSale; | |||
use common\logic\PointSale\PointSale\Service\PointSaleDefinition; | |||
use yii\db\ActiveQuery; | |||
class PointSaleRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected PointSaleDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return PointSale::find(); | |||
$this->loadDefinition(PointSaleDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\PointSale\PointSale\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\PointSale\PointSale\Model\PointSale; | |||
class PointSaleDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return PointSale::class; | |||
} | |||
} |
@@ -3,27 +3,28 @@ | |||
namespace common\logic\PointSale\PointSale\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\PointSale\PointSale\Model\PointSale; | |||
use common\logic\PointSale\PointSale\Repository\PointSaleRepository; | |||
use common\logic\PointSale\PointSale\Service\PointSaleBuilder; | |||
use common\logic\PointSale\PointSale\Service\PointSaleDefinition; | |||
use common\logic\PointSale\PointSale\Service\PointSaleSolver; | |||
class PointSaleContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return PointSale::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
PointSaleDefinition::class, | |||
PointSaleSolver::class, | |||
PointSaleRepository::class, | |||
PointSaleBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): PointSaleDefinition | |||
{ | |||
return PointSaleDefinition::getInstance(); | |||
} | |||
public function getSolver(): PointSaleSolver | |||
{ | |||
return PointSaleSolver::getInstance(); |
@@ -5,9 +5,11 @@ namespace common\logic\PointSale\PointSale\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\PointSale\PointSale\Repository\PointSaleRepository; | |||
use common\logic\PointSale\PointSale\Service\PointSaleBuilder; | |||
use common\logic\PointSale\PointSale\Service\PointSaleDefinition; | |||
use common\logic\PointSale\PointSale\Service\PointSaleSolver; | |||
/** | |||
* @mixin PointSaleDefinition | |||
* @mixin PointSaleSolver | |||
* @mixin PointSaleRepository | |||
* @mixin PointSaleBuilder |
@@ -13,7 +13,7 @@ class UserPointSaleRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(UserPointSaleRepositoryQuery::class); | |||
$this->loadQuery(UserPointSaleRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\PointSale\UserPointSale\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\PointSale\UserPointSale\Model\UserPointSale; | |||
use common\logic\PointSale\UserPointSale\Service\UserPointSaleDefinition; | |||
use yii\db\ActiveQuery; | |||
class UserPointSaleRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected UserPointSaleDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return UserPointSale::find(); | |||
$this->loadDefinition(UserPointSaleDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\PointSale\UserPointSale\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\PointSale\UserPointSale\Model\UserPointSale; | |||
class UserPointSaleDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return UserPointSale::class; | |||
} | |||
} |
@@ -3,25 +3,26 @@ | |||
namespace common\logic\PointSale\UserPointSale\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\PointSale\UserPointSale\Model\UserPointSale; | |||
use common\logic\PointSale\UserPointSale\Repository\UserPointSaleRepository; | |||
use common\logic\PointSale\UserPointSale\Service\UserPointSaleBuilder; | |||
use common\logic\PointSale\UserPointSale\Service\UserPointSaleDefinition; | |||
class UserPointSaleContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return UserPointSale::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
UserPointSaleDefinition::class, | |||
UserPointSaleRepository::class, | |||
UserPointSaleBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): UserPointSaleDefinition | |||
{ | |||
return UserPointSaleDefinition::getInstance(); | |||
} | |||
public function getRepository(): UserPointSaleRepository | |||
{ | |||
return UserPointSaleRepository::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\PointSale\UserPointSale\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\PointSale\UserPointSale\Repository\UserPointSaleRepository; | |||
use common\logic\PointSale\UserPointSale\Service\UserPointSaleBuilder; | |||
use common\logic\PointSale\UserPointSale\Service\UserPointSaleDefinition; | |||
/** | |||
* @mixin UserPointSaleDefinition | |||
* @mixin UserPointSaleRepository | |||
* @mixin UserPointSaleBuilder | |||
*/ |
@@ -24,7 +24,7 @@ class ProducerRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProducerRepositoryQuery::class); | |||
$this->loadQuery(ProducerRepositoryQuery::class); | |||
$this->producerPriceRangeRepository = $this->loadService(ProducerPriceRangeRepository::class); | |||
$this->producerSolver = $this->loadService(ProducerSolver::class); | |||
$this->documentSolver = $this->loadService(DocumentSolver::class); |
@@ -4,12 +4,15 @@ namespace common\logic\Producer\Producer\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
use common\logic\Producer\Producer\Service\ProducerDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProducerRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProducerDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return Producer::find(); | |||
$this->loadDefinition(ProducerDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Producer\Producer\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
class ProducerDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Producer::class; | |||
} | |||
} |
@@ -3,22 +3,18 @@ | |||
namespace common\logic\Producer\Producer\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||
use common\logic\Producer\Producer\Service\ProducerBuilder; | |||
use common\logic\Producer\Producer\Service\ProducerDefinition; | |||
use common\logic\Producer\Producer\Service\ProducerSolver; | |||
use common\logic\Producer\Producer\Service\ProducerUtils; | |||
class ProducerContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Producer::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProducerDefinition::class, | |||
ProducerSolver::class, | |||
ProducerRepository::class, | |||
ProducerBuilder::class, | |||
@@ -26,6 +22,11 @@ class ProducerContainer extends AbstractContainer | |||
]; | |||
} | |||
public function getDefinition(): ProducerDefinition | |||
{ | |||
return ProducerDefinition::getInstance(); | |||
} | |||
public function getSolver(): ProducerSolver | |||
{ | |||
return ProducerSolver::getInstance(); |
@@ -5,10 +5,12 @@ namespace common\logic\Producer\Producer\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Producer\Producer\Repository\ProducerRepository; | |||
use common\logic\Producer\Producer\Service\ProducerBuilder; | |||
use common\logic\Producer\Producer\Service\ProducerDefinition; | |||
use common\logic\Producer\Producer\Service\ProducerSolver; | |||
use common\logic\Producer\Producer\Service\ProducerUtils; | |||
/** | |||
* @mixin ProducerDefinition | |||
* @mixin ProducerSolver | |||
* @mixin ProducerRepository | |||
* @mixin ProducerBuilder |
@@ -12,7 +12,7 @@ class ProducerPriceRangeRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProducerPriceRangeRepositoryQuery::class); | |||
$this->loadQuery(ProducerPriceRangeRepositoryQuery::class); | |||
} | |||
/** |
@@ -4,12 +4,15 @@ namespace common\logic\Producer\ProducerPriceRange\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Producer\ProducerPriceRange\Model\ProducerPriceRange; | |||
use common\logic\Producer\ProducerPriceRange\Service\ProducerPriceRangeDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProducerPriceRangeRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProducerPriceRangeDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProducerPriceRange::find(); | |||
$this->loadDefinition(ProducerPriceRangeDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace common\logic\Producer\ProducerPriceRange\Service; | |||
use common\logic\AbstractDefinition; | |||
class ProducerPriceRangeDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProducerPriceRangeDefinition::class; | |||
} | |||
} |
@@ -3,25 +3,26 @@ | |||
namespace common\logic\Producer\ProducerPriceRange\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Producer\ProducerPriceRange\Model\ProducerPriceRange; | |||
use common\logic\Producer\ProducerPriceRange\Repository\ProducerPriceRangeRepository; | |||
use common\logic\Producer\ProducerPriceRange\Service\ProducerPriceRangeBuilder; | |||
use common\logic\Producer\ProducerPriceRange\Service\ProducerPriceRangeDefinition; | |||
class ProducerPriceRangeContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProducerPriceRange::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProducerPriceRangeDefinition::class, | |||
ProducerPriceRangeRepository::class, | |||
ProducerPriceRangeBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): ProducerPriceRangeDefinition | |||
{ | |||
return ProducerPriceRangeDefinition::getInstance(); | |||
} | |||
public function getRepository(): ProducerPriceRangeRepository | |||
{ | |||
return ProducerPriceRangeRepository::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Producer\ProducerPriceRange\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Producer\ProducerPriceRange\Repository\ProducerPriceRangeRepository; | |||
use common\logic\Producer\ProducerPriceRange\Service\ProducerPriceRangeBuilder; | |||
use common\logic\Producer\ProducerPriceRange\Service\ProducerPriceRangeDefinition; | |||
/** | |||
* @mixin ProducerPriceRangeDefinition | |||
* @mixin ProducerPriceRangeRepository | |||
* @mixin ProducerPriceRangeBuilder | |||
*/ |
@@ -23,7 +23,7 @@ class ProductRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductRepositoryQuery::class); | |||
$this->loadQuery(ProductRepositoryQuery::class); | |||
$this->productSolver = $this->loadService(ProductSolver::class); | |||
$this->productPriceSolver = $this->loadService(ProductPriceSolver::class); | |||
$this->userProducerRepository = $this->loadService(UserProducerRepository::class); |
@@ -3,13 +3,14 @@ | |||
namespace common\logic\Product\Product\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Product\Product\Model\Product; | |||
use yii\db\ActiveQuery; | |||
use common\logic\Product\Product\Service\ProductDefinition; | |||
class ProductRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return Product::find(); | |||
$this->loadDefinition(ProductDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Product\Product\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Product\Product\Model\Product; | |||
class ProductDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Product::class; | |||
} | |||
} |
@@ -3,27 +3,29 @@ | |||
namespace common\logic\Product\Product\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Product\Product\Model\Product; | |||
use common\logic\DefinitionInterface; | |||
use common\logic\Product\Product\Repository\ProductRepository; | |||
use common\logic\Product\Product\Service\ProductBuilder; | |||
use common\logic\Product\Product\Service\ProductDefinition; | |||
use common\logic\Product\Product\Service\ProductSolver; | |||
class ProductContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return Product::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProductDefinition::class, | |||
ProductSolver::class, | |||
ProductBuilder::class, | |||
ProductRepository::class, | |||
]; | |||
} | |||
public function getDefinition(): DefinitionInterface | |||
{ | |||
return ProductDefinition::getInstance(); | |||
} | |||
public function getSolver(): ProductSolver | |||
{ | |||
return ProductSolver::getInstance(); |
@@ -5,9 +5,11 @@ namespace common\logic\Product\Product\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Product\Product\Repository\ProductRepository; | |||
use common\logic\Product\Product\Service\ProductBuilder; | |||
use common\logic\Product\Product\Service\ProductDefinition; | |||
use common\logic\Product\Product\Service\ProductSolver; | |||
/** | |||
* @mixin ProductDefinition | |||
* @mixin ProductSolver | |||
* @mixin ProductRepository | |||
* @mixin ProductBuilder |
@@ -11,7 +11,7 @@ class ProductCategoryRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductCategoryRepositoryQuery::class); | |||
$this->loadQuery(ProductCategoryRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Product\ProductCategory\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Product\ProductCategory\Model\ProductCategory; | |||
use common\logic\Product\ProductCategory\Service\ProductCategoryDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProductCategoryRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductCategoryDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProductCategory::find(); | |||
$this->loadDefinition(ProductCategoryDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
<?php | |||
namespace common\logic\Product\ProductCategory\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Product\ProductCategory\Model\ProductCategory; | |||
class ProductCategoryDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductCategory::class; | |||
} | |||
} |
@@ -3,25 +3,27 @@ | |||
namespace common\logic\Product\ProductCategory\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Product\ProductCategory\Model\ProductCategory; | |||
use common\logic\DefinitionInterface; | |||
use common\logic\Product\ProductCategory\Repository\ProductCategoryRepository; | |||
use common\logic\Product\ProductCategory\Service\ProductCategoryBuilder; | |||
use common\logic\Product\ProductCategory\Service\ProductCategoryDefinition; | |||
class ProductCategoryContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductCategory::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProductCategoryDefinition::class, | |||
ProductCategoryBuilder::class, | |||
ProductCategoryRepository::class | |||
]; | |||
} | |||
public function getDefinition(): DefinitionInterface | |||
{ | |||
return ProductCategoryDefinition::getInstance(); | |||
} | |||
public function getBuilder(): ProductCategoryBuilder | |||
{ | |||
return ProductCategoryBuilder::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Product\ProductCategory\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Product\ProductCategory\Repository\ProductCategoryRepository; | |||
use common\logic\Product\ProductCategory\Service\ProductCategoryBuilder; | |||
use common\logic\Product\ProductCategory\Service\ProductCategoryDefinition; | |||
/** | |||
* @mixin ProductCategoryDefinition | |||
* @mixin ProductCategoryRepository | |||
* @mixin ProductCategoryBuilder | |||
*/ |
@@ -10,7 +10,7 @@ class ProductPointSaleRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductPointSaleRepositoryQuery::class); | |||
$this->loadQuery(ProductPointSaleRepositoryQuery::class); | |||
} | |||
public function getDefaultOptionsSearch(): array |
@@ -4,12 +4,15 @@ namespace common\logic\Product\ProductPointSale\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Product\ProductPointSale\Model\ProductPointSale; | |||
use common\logic\Product\ProductPointSale\Service\ProductPointSaleDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProductPointSaleRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductPointSaleDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProductPointSale::find(); | |||
$this->loadDefinition(ProductPointSaleDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Product\ProductPointSale\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Product\ProductPointSale\Model\ProductPointSale; | |||
class ProductPointSaleDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductPointSale::class; | |||
} | |||
} |
@@ -3,25 +3,27 @@ | |||
namespace common\logic\Product\ProductPointSale\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Product\ProductPointSale\Model\ProductPointSale; | |||
use common\logic\DefinitionInterface; | |||
use common\logic\Product\ProductPointSale\Repository\ProductPointSaleRepository; | |||
use common\logic\Product\ProductPointSale\Service\ProductPointSaleBuilder; | |||
use common\logic\Product\ProductPointSale\Service\ProductPointSaleDefinition; | |||
class ProductPointSaleContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductPointSale::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProductPointSaleDefinition::class, | |||
ProductPointSaleRepository::class, | |||
ProductPointSaleBuilder::class, | |||
]; | |||
} | |||
public function getDefinition(): DefinitionInterface | |||
{ | |||
return ProductPointSaleDefinition::getInstance(); | |||
} | |||
public function getRepository(): ProductPointSaleRepository | |||
{ | |||
return ProductPointSaleRepository::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Product\ProductPointSale\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Product\ProductPointSale\Repository\ProductPointSaleRepository; | |||
use common\logic\Product\ProductPointSale\Service\ProductPointSaleBuilder; | |||
use common\logic\Product\ProductPointSale\Service\ProductPointSaleDefinition; | |||
/** | |||
* @mixin ProductPointSaleDefinition | |||
* @mixin ProductPointSaleRepository | |||
* @mixin ProductPointSaleBuilder | |||
*/ |
@@ -15,7 +15,7 @@ class ProductPriceRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductPriceRepositoryQuery::class); | |||
$this->loadQuery(ProductPriceRepositoryQuery::class); | |||
} | |||
/** |
@@ -4,12 +4,15 @@ namespace common\logic\Product\ProductPrice\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Product\ProductPrice\Model\ProductPrice; | |||
use common\logic\Product\ProductPrice\Service\ProductPriceDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProductPriceRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductPriceDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProductPrice::find(); | |||
$this->loadDefinition(ProductPriceDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Product\ProductPrice\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Product\ProductPrice\Model\ProductPrice; | |||
class ProductPriceDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductPrice::class; | |||
} | |||
} |
@@ -3,27 +3,28 @@ | |||
namespace common\logic\Product\ProductPrice\Wrapper; | |||
use common\logic\AbstractContainer; | |||
use common\logic\Product\ProductPrice\Model\ProductPrice; | |||
use common\logic\Product\ProductPrice\Repository\ProductPriceRepository; | |||
use common\logic\Product\ProductPrice\Service\ProductPriceBuilder; | |||
use common\logic\Product\ProductPrice\Service\ProductPriceDefinition; | |||
use common\logic\Product\ProductPrice\Service\ProductPriceSolver; | |||
class ProductPriceContainer extends AbstractContainer | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductPrice::class; | |||
} | |||
public function getServices(): array | |||
{ | |||
return [ | |||
ProductPriceDefinition::class, | |||
ProductPriceSolver::class, | |||
ProductPriceBuilder::class, | |||
ProductPriceRepository::class | |||
]; | |||
} | |||
public function getDefinition(): ProductPriceDefinition | |||
{ | |||
return ProductPriceDefinition::getInstance(); | |||
} | |||
public function getBuilder(): ProductPriceBuilder | |||
{ | |||
return ProductPriceBuilder::getInstance(); |
@@ -5,8 +5,10 @@ namespace common\logic\Product\ProductPrice\Wrapper; | |||
use common\logic\AbstractManager; | |||
use common\logic\Product\ProductPrice\Repository\ProductPriceRepository; | |||
use common\logic\Product\ProductPrice\Service\ProductPriceBuilder; | |||
use common\logic\Product\ProductPrice\Service\ProductPriceDefinition; | |||
/** | |||
* @mixin ProductPriceDefinition | |||
* @mixin ProductPriceRepository | |||
* @mixin ProductPriceBuilder | |||
*/ |
@@ -6,5 +6,5 @@ use yii\db\ActiveQuery; | |||
interface RepositoryQueryInterface | |||
{ | |||
public function baseQuery(): ActiveQuery; | |||
} |
@@ -12,7 +12,7 @@ class ProductSubscriptionRepository extends AbstractRepository | |||
public function loadDependencies(): void | |||
{ | |||
$this->query = $this->loadService(ProductSubscriptionRepositoryQuery::class); | |||
$this->loadQuery(ProductSubscriptionRepositoryQuery::class); | |||
} | |||
/** |
@@ -4,12 +4,15 @@ namespace common\logic\Subscription\ProductSubscription\Repository; | |||
use common\logic\AbstractRepositoryQuery; | |||
use common\logic\Subscription\ProductSubscription\Model\ProductSubscription; | |||
use common\logic\Subscription\ProductSubscription\Service\ProductSubscriptionDefinition; | |||
use yii\db\ActiveQuery; | |||
class ProductSubscriptionRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function baseQuery(): ActiveQuery | |||
protected ProductSubscriptionDefinition $definition; | |||
public function loadDependencies(): void | |||
{ | |||
return ProductSubscription::find(); | |||
$this->loadDefinition(ProductSubscriptionDefinition::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace common\logic\Subscription\ProductSubscription\Service; | |||
use common\logic\AbstractDefinition; | |||
use common\logic\Subscription\ProductSubscription\Model\ProductSubscription; | |||
class ProductSubscriptionDefinition extends AbstractDefinition | |||
{ | |||
public function getEntityFqcn(): string | |||
{ | |||
return ProductSubscription::class; | |||
} | |||
} |