Refactor class.Product.php and class.S.php for improved code readability and maintainability

This commit is contained in:
2024-10-29 11:26:06 +01:00
parent f9fed8def3
commit 4f1f4fa4da
15 changed files with 1360 additions and 1717 deletions

View File

@@ -65,18 +65,18 @@ class Layouts
if ( !$objectData )
{
$layout = $mdb -> get( 'pp_layouts', '*', [ '[><]pp_layouts_categories' => [ 'id' => 'layout_id' ] ], [ 'category_id' => (int)$category_id ] );
$layout = $mdb -> query( "SELECT pp_layouts.* FROM pp_layouts JOIN pp_layouts_categories ON pp_layouts.id = pp_layouts_categories.layout_id WHERE pp_layouts_categories.category_id = " . (int)$category_id ) -> fetchAll( \PDO::FETCH_ASSOC );
if ( !$layout )
$layout = $mdb -> get( 'pp_layouts', '*', [ 'categories_default' => 1 ] );
$cacheHandler -> set( $cacheKey, $layout );
$cacheHandler -> set( $cacheKey, $layout[0] );
}
else
{
return unserialize( $objectData );
}
return $layout;
return $layout[0];
}
static public function active_layout( $page_id )