feat(domain): Domain\Authors + Domain\Newsletter repositories z wrapper delegation

Phase 4 complete:
- AuthorsRepository: simpleList, authorDetails, authorSave, authorDelete, authorByLang
- NewsletterRepository: 14 methods — subscriber lifecycle, templates, sending
- 4 legacy factories converted to thin wrappers
- Globals ($settings, $lang) passed as explicit params to repo methods

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 18:21:32 +02:00
parent 73ff0ca5b6
commit ffe661b4d2
11 changed files with 833 additions and 273 deletions

View File

@@ -1,4 +1,4 @@
<?
<?php
namespace front\factory;
class Authors
{
@@ -6,17 +6,7 @@ class Authors
static public function get_single_author( $id_author )
{
global $mdb;
if ( !$author = \Cache::fetch( "get_single_author:$id_author" ) )
{
$author = $mdb -> get( 'pp_authors', '*', [ 'id' => (int)$id_author ] );
$results = $mdb -> select( 'pp_authors_langs', '*', [ 'id_author' => (int)$id_author ] );
if ( is_array( $results ) ) foreach ( $results as $row )
$author['languages'][$row['id_lang']] = $row;
\Cache::store( "get_single_author:$id_author", $author );
}
return $author;
$repo = new \Domain\Authors\AuthorsRepository($mdb);
return $repo->authorByLang($id_author);
}
}