mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-17 03:04:47 -05:00
22 lines
517 B
PHP
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(),
|
|
];
|
|
}
|
|
}
|