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 46ff934d42
commit 827b903e1e
19 changed files with 267 additions and 119 deletions

View File

@@ -301,6 +301,34 @@ class ProducerRepository
return is_array($rows) ? array_map('intval', $rows) : [];
}
/**
* Aktywni producenci z pelnym danymi (frontend lista).
*
* @return array<int, array{id: int, name: string, img: string|null}>
*/
public function allActiveProducers(): array
{
$rows = $this->db->select('pp_shop_producer', ['id', 'name', 'img'], [
'status' => 1,
'ORDER' => ['name' => 'ASC'],
]);
if (!is_array($rows)) {
return [];
}
$producers = [];
foreach ($rows as $row) {
$producers[] = [
'id' => (int)($row['id'] ?? 0),
'name' => (string)($row['name'] ?? ''),
'img' => $row['img'] ?? null,
];
}
return $producers;
}
private function defaultProducer(): array
{
return [