This repository was archived by the owner on Feb 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +37
-76
lines changed
Expand file tree Collapse file tree 6 files changed +37
-76
lines changed Original file line number Diff line number Diff line change 1111use Ergonode \SharedKernel \Domain \Aggregate \UserId ;
1212use Ergonode \SharedKernel \Domain \User \UserInterface ;
1313use Doctrine \DBAL \Connection ;
14- use Ergonode \ Core \ Application \ Security \Security ;
14+ use Symfony \ Component \ Security \ Core \Security ;
1515
1616abstract class AbstractAuditEventHandler
1717{
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99
1010namespace Ergonode \Product \Infrastructure \Handler \Update ;
1111
12+ use Ergonode \Product \Domain \Repository \ProductRepositoryInterface ;
1213use Webmozart \Assert \Assert ;
1314use Ergonode \Product \Domain \Command \Update \UpdateGroupingProductCommand ;
14- use Ergonode \Product \Infrastructure \Handler \AbstractUpdateProductHandler ;
1515
16- class UpdateGroupingProductCommandHandler extends AbstractUpdateProductHandler
16+ class UpdateGroupingProductCommandHandler
1717{
18+ private ProductRepositoryInterface $ productRepository ;
19+
20+ public function __construct (ProductRepositoryInterface $ productRepository )
21+ {
22+ $ this ->productRepository = $ productRepository ;
23+ }
24+
1825 /**
1926 * @throws \Exception
2027 */
@@ -25,7 +32,6 @@ public function __invoke(UpdateGroupingProductCommand $command): void
2532
2633 $ product ->changeTemplate ($ command ->getTemplateId ());
2734 $ product ->changeCategories ($ command ->getCategories ());
28- $ product = $ this ->updateAudit ($ product );
2935
3036 $ this ->productRepository ->save ($ product );
3137 }
Original file line number Diff line number Diff line change 99
1010namespace Ergonode \Product \Infrastructure \Handler \Update ;
1111
12+ use Ergonode \Product \Domain \Repository \ProductRepositoryInterface ;
1213use Webmozart \Assert \Assert ;
1314use Ergonode \Product \Domain \Command \Update \UpdateSimpleProductCommand ;
14- use Ergonode \Product \Infrastructure \Handler \AbstractUpdateProductHandler ;
1515
16- class UpdateSimpleProductCommandHandler extends AbstractUpdateProductHandler
16+ class UpdateSimpleProductCommandHandler
1717{
18+ private ProductRepositoryInterface $ productRepository ;
19+
20+ public function __construct (ProductRepositoryInterface $ productRepository )
21+ {
22+ $ this ->productRepository = $ productRepository ;
23+ }
24+
1825 /**
1926 * @throws \Exception
2027 */
@@ -25,7 +32,6 @@ public function __invoke(UpdateSimpleProductCommand $command): void
2532
2633 $ product ->changeTemplate ($ command ->getTemplateId ());
2734 $ product ->changeCategories ($ command ->getCategories ());
28- $ product = $ this ->updateAudit ($ product );
2935
3036 $ this ->productRepository ->save ($ product );
3137 }
Original file line number Diff line number Diff line change 99
1010namespace Ergonode \Product \Infrastructure \Handler \Update ;
1111
12+ use Ergonode \Product \Domain \Repository \ProductRepositoryInterface ;
1213use Webmozart \Assert \Assert ;
1314use Ergonode \Product \Domain \Command \Update \UpdateVariableProductCommand ;
14- use Ergonode \Product \Infrastructure \Handler \AbstractUpdateProductHandler ;
1515use Ergonode \Product \Domain \Entity \VariableProduct ;
1616
17- class UpdateVariableProductCommandHandler extends AbstractUpdateProductHandler
17+ class UpdateVariableProductCommandHandler
1818{
19+ private ProductRepositoryInterface $ productRepository ;
20+
21+ public function __construct (ProductRepositoryInterface $ productRepository )
22+ {
23+ $ this ->productRepository = $ productRepository ;
24+ }
25+
1926 /**
2027 * @throws \Exception
2128 */
@@ -27,7 +34,6 @@ public function __invoke(UpdateVariableProductCommand $command): void
2734
2835 $ product ->changeTemplate ($ command ->getTemplateId ());
2936 $ product ->changeCategories ($ command ->getCategories ());
30- $ product = $ this ->updateAudit ($ product );
3137
3238 $ this ->productRepository ->save ($ product );
3339 }
Original file line number Diff line number Diff line change 99
1010namespace Ergonode \Product \Infrastructure \Handler ;
1111
12+ use Ergonode \Product \Domain \Repository \ProductRepositoryInterface ;
1213use Webmozart \Assert \Assert ;
1314use Ergonode \Product \Domain \Command \UpdateProductCategoriesCommand ;
1415
15- class UpdateProductCategoriesCommandHandler extends AbstractUpdateProductHandler
16+ class UpdateProductCategoriesCommandHandler
1617{
18+ private ProductRepositoryInterface $ productRepository ;
19+
20+ public function __construct (ProductRepositoryInterface $ productRepository )
21+ {
22+ $ this ->productRepository = $ productRepository ;
23+ }
24+
1725 /**
1826 * @throws \Exception
1927 */
@@ -23,7 +31,6 @@ public function __invoke(UpdateProductCategoriesCommand $command): void
2331 Assert::notNull ($ product );
2432
2533 $ product ->changeCategories ($ command ->getCategories ());
26- $ product = $ this ->updateAudit ($ product );
2734
2835 $ this ->productRepository ->save ($ product );
2936 }
You can’t perform that action at this time.
0 commit comments