ver. 0.284: DbModel elimination, update packages for 0.283-0.284

- Removed class.DbModel.php — only consumer (shop\Promotion) now has
  inlined constructor + __get()
- Created update packages: ver_0.283.zip (S→Helpers migration, ~130 files),
  ver_0.284.zip (DbModel removal)
- Updated docs: CHANGELOG, PROJECT_STRUCTURE, FRONTEND_REFACTORING_PLAN

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 23:31:03 +01:00
parent 431add234c
commit 6922b66eed
12 changed files with 99 additions and 103 deletions

View File

@@ -1,11 +1,9 @@
<?php
namespace shop;
use DbModel;
class Promotion extends DbModel
class Promotion
{
public $table = 'pp_shop_promotion';
private $data = [];
public static $condition_type = [
1 => 'Rabat procentowy na produkty z kategorii 1 jeżeli w koszyku jest produkt z kategorii 2',
@@ -17,6 +15,25 @@ class Promotion extends DbModel
public static $discount_type = [ 1 => 'Rabat procentowy' ];
public function __construct( $id )
{
global $mdb;
if ( $id )
{
$result = $mdb->get( 'pp_shop_promotion', '*', [ 'id' => $id ] );
if ( is_array( $result ) )
$this->data = $result;
}
}
public function __get( $variable )
{
if ( isset( $this->data[$variable] ) )
return $this->data[$variable];
return null;
}
public static function get_active_promotions()
{
global $mdb;