2021-02-10 16:20:01 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @copyright 2020 Podlibre
|
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Entities;
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
use CodeIgniter\Entity\Entity;
|
2021-02-10 16:20:01 +00:00
|
|
|
use App\Models\PersonModel;
|
|
|
|
|
|
|
|
class EpisodePerson extends Entity
|
|
|
|
{
|
|
|
|
/**
|
2021-05-06 14:00:48 +00:00
|
|
|
* @var Person
|
2021-02-10 16:20:01 +00:00
|
|
|
*/
|
|
|
|
protected $person;
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
2021-02-10 16:20:01 +00:00
|
|
|
protected $casts = [
|
|
|
|
'id' => 'integer',
|
|
|
|
'podcast_id' => 'integer',
|
|
|
|
'episode_id' => 'integer',
|
|
|
|
'person_id' => 'integer',
|
|
|
|
'person_group' => '?string',
|
|
|
|
'person_role' => '?string',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function getPerson()
|
|
|
|
{
|
|
|
|
return (new PersonModel())->getPersonById(
|
2021-05-06 14:00:48 +00:00
|
|
|
$this->attributes['person_id'],
|
2021-02-10 16:20:01 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|