refactor(persons): move podcast and episode persons models to person model for consistency

- fix lazy loading properties + podcast import controller
- rename all snake_case variables to
camelCase
- fix broken routes
- refactor Location construction logic and setters
This commit is contained in:
Yassine Doghri 2021-05-17 17:11:23 +00:00
commit 93e605b406
No known key found for this signature in database
GPG key ID: 3E7F89498B960C9F
48 changed files with 844 additions and 826 deletions

View file

@ -39,18 +39,21 @@ class AnalyticsController extends Controller
);
}
public function getData(int $podcastId, int $episodeId): ResponseInterface
{
$analytics_model = new $this->className();
public function getData(
int $podcastId,
?int $episodeId = null
): ResponseInterface {
$analyticsModel = new $this->className();
$methodName = $this->methodName;
if ($episodeId !== 0) {
if ($episodeId === null) {
return $this->response->setJSON(
$analytics_model->$methodName($podcastId, $episodeId),
$analyticsModel->$methodName($podcastId),
);
}
return $this->response->setJSON(
$analytics_model->$methodName($podcastId),
$analyticsModel->$methodName($podcastId, $episodeId),
);
}
}