first commit
This commit is contained in:
22
autoload/front/factory/class.Authors.php
Normal file
22
autoload/front/factory/class.Authors.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?
|
||||
namespace front\factory;
|
||||
class Authors
|
||||
{
|
||||
// szczególy autora
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user