Initial dev export (exclude uploads/runtime)
This commit is contained in:
25
core/services/Nav.php
Normal file
25
core/services/Nav.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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 ?: [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user