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:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user