Files
cmsPRO/autoload/Domain/SeoAdditional/SeoAdditionalRepository.php
Jacek Pyziak f7c7c0bb88 feat(05-domain-seoadditional-cron-releases): Domain layer kompletny — SeoAdditional + Cron + Releases
Phase 5 complete:
- Domain\SeoAdditional\SeoAdditionalRepository (elementDelete, elementSave, elementDetails)
- Domain\Cron\CronRepository (3 pub + 12 private helper methods)
- Domain\Releases\ReleasesRepository (9 metod: wersje, licencje, discover)
- Domain\Releases\UpdateRepository (auto-update, konstruktor($db, $settings))
- 4 legacy factory wrappers zaktualizowane do wrapper delegation

Domain layer: 13/13 repozytoriów kompletnych.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 00:57:13 +02:00

58 lines
1.2 KiB
PHP

<?php
namespace Domain\SeoAdditional;
class SeoAdditionalRepository
{
private $db;
public function __construct($db)
{
$this->db = $db;
}
public function elementDelete($elementId)
{
return $this->db->delete('pp_seo_additional', ['id' => (int)$elementId]);
}
public function elementSave($id, $url, $status, $title, $keywords, $description, $text)
{
if (!$id)
{
if ($this->db->insert('pp_seo_additional', [
'url' => $url,
'status' => $status == 'on' ? 1 : 0,
'title' => $title,
'keywords' => $keywords,
'description' => $description,
'text' => $text
]))
{
\S::delete_cache();
return $this->db->id();
}
}
else
{
$this->db->update('pp_seo_additional', [
'url' => $url,
'status' => $status == 'on' ? 1 : 0,
'title' => $title,
'keywords' => $keywords,
'description' => $description,
'text' => $text
], [
'id' => (int)$id
]);
\S::delete_cache();
return $id;
}
}
public function elementDetails($elementId)
{
return $this->db->get('pp_seo_additional', '*', ['id' => (int)$elementId]);
}
}