<?php

namespace App\Services;

use App\Core\Database;

class HomepageMeshService
{

public static function registry(
int $orgId
): array
{

$db=
Database::getInstance();

$stmt=
$db
->prepare("

SELECT

component_key,

component_type,

version_no,

created_at

FROM
conference_home_components

WHERE org_id=?

ORDER BY id DESC

LIMIT 50

");

$stmt
->execute([

$orgId

]);

return
$stmt
->fetchAll()

??

[];

}

public static function themes(
int $orgId
): array
{

$db=
Database::getInstance();

$stmt=
$db
->prepare("

SELECT

theme_name,

theme_key,

is_default

FROM
conference_home_themes

WHERE org_id=?

ORDER BY id DESC

");

$stmt
->execute([

$orgId

]);

return
$stmt
->fetchAll()

??

[];

}

}
