ver. 0.294: Remove all 12 legacy autoload/shop/ classes (~2363 lines)
Complete Domain-Driven Architecture migration: - Phase 1-4: Transport, ProductSet, Coupon, Shop, Search, Basket, ProductCustomField, Category, ProductAttribute, Promotion - Phase 5: Order (~562 lines) + Product (~952 lines) - ~20 Product methods migrated to ProductRepository - Apilo sync migrated to OrderAdminService - Production hotfixes: stale Redis cache (prices 0.00), unqualified Product:: refs in LayoutEngine, object->array template conversion - AttributeRepository::getAttributeValueById() Redis cache added Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,7 @@ class App
|
||||
// wyświetlenie pojedynczego produktu
|
||||
if ( $product )
|
||||
{
|
||||
\shop\Product::add_visit( $product -> id );
|
||||
( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->addVisit( (int)$product['id'] );
|
||||
return \Shared\Tpl\Tpl::view( 'shop-product/product', [
|
||||
'product' => $product,
|
||||
'settings' => $settings,
|
||||
@@ -76,18 +76,6 @@ class App
|
||||
// stare klasy
|
||||
$class = '\front\controls\\' . $moduleName;
|
||||
|
||||
if ( class_exists( $class ) and method_exists( new $class, $action ) )
|
||||
return call_user_func_array( array( $class, $action ), array() );
|
||||
|
||||
// klasy sklepowe
|
||||
$class = '\shop\\';
|
||||
|
||||
$results = explode( '_', \Shared\Helpers\Helpers::get( 'module' ) );
|
||||
if ( is_array( $results ) ) foreach ( $results as $row )
|
||||
$class .= ucfirst( $row );
|
||||
|
||||
$action = \Shared\Helpers\Helpers::get( 'action' );
|
||||
|
||||
if ( class_exists( $class ) and method_exists( new $class, $action ) )
|
||||
return call_user_func_array( array( $class, $action ), array() );
|
||||
|
||||
@@ -188,8 +176,10 @@ class App
|
||||
},
|
||||
'ShopOrder' => function() {
|
||||
global $mdb;
|
||||
$orderRepo = new \Domain\Order\OrderRepository( $mdb );
|
||||
return new \front\Controllers\ShopOrderController(
|
||||
new \Domain\Order\OrderRepository( $mdb )
|
||||
$orderRepo,
|
||||
new \Domain\Order\OrderAdminService( $orderRepo )
|
||||
);
|
||||
},
|
||||
'ShopProducer' => function() {
|
||||
@@ -204,6 +194,9 @@ class App
|
||||
new \Domain\Category\CategoryRepository( $mdb )
|
||||
);
|
||||
},
|
||||
'Search' => function() {
|
||||
return new \front\Controllers\SearchController();
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user