26 lines
527 B
PHP
26 lines
527 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Core\Services;
|
|
|
|
use PDO;
|
|
use Throwable;
|
|
|
|
class Nav
|
|
{
|
|
public static function links(): array
|
|
{
|
|
$db = Database::get();
|
|
if (!$db instanceof PDO) {
|
|
return [];
|
|
}
|
|
try {
|
|
$stmt = $db->query("SELECT id, label, url, sort_order, is_active FROM ac_nav_links ORDER BY sort_order ASC, id ASC");
|
|
$rows = $stmt->fetchAll();
|
|
} catch (Throwable $e) {
|
|
return [];
|
|
}
|
|
return $rows ?: [];
|
|
}
|
|
}
|