Files
ops-Gazelle/app/API/Artist.php
2025-02-24 14:37:56 +01:00

22 lines
517 B
PHP

<?php
namespace Gazelle\API;
class Artist extends AbstractAPI {
public function run(): array {
if (empty($_GET['artist_id'])) {
json_error('Missing artist id');
}
$artistMan = new \Gazelle\Manager\Artist();
$artist = $artistMan->findById((int)$_GET['artist_id']);
if (is_null($artist)) {
json_error('Artist not found');
}
return [
'ArtistID' => $artist->id(),
'Name' => $artist->name(),
];
}
}