ver. 0.291: ShopProducer frontend migration to Domain + Controllers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 20:32:07 +01:00
parent 1ba0c12327
commit 6181ef958d
19 changed files with 267 additions and 119 deletions

View File

@@ -1,54 +0,0 @@
<?php
namespace shop;
class Producer implements \ArrayAccess
{
public function __construct( int $producer_id )
{
global $mdb;
$repo = new \Domain\Producer\ProducerRepository( $mdb );
$data = $repo->find( $producer_id );
foreach ( $data as $key => $val )
$this->$key = $val;
}
static public function producer_products( $producer_id, $lang_id, $bs )
{
global $mdb;
$repo = new \Domain\Producer\ProducerRepository( $mdb );
return $repo->producerProducts( (int) $producer_id, 12, (int) $bs );
}
public function __get( $variable )
{
if ( array_key_exists( $variable, $this -> data ) )
return $this -> $variable;
}
public function __set( $variable, $value )
{
$this -> $variable = $value;
}
public function offsetExists( $offset )
{
return isset( $this -> $offset );
}
public function offsetGet( $offset )
{
return $this -> $offset;
}
public function offsetSet( $offset, $value )
{
$this -> $offset = $value;
}
public function offsetUnset( $offset )
{
unset( $this -> $offset );
}
}