mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-11 10:05:09 +00:00

- move and refactor Image.php from Libraries to Entities folder - update some database field names / types - update composer packages
47 lines
934 B
PHP
47 lines
934 B
PHP
<?php
|
|
|
|
/**
|
|
* @copyright 2020 Podlibre
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace App\Entities;
|
|
|
|
use CodeIgniter\Entity\Entity;
|
|
use App\Models\PersonModel;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $podcast_id
|
|
* @property int $person_id
|
|
* @property Person $person
|
|
* @property string|null $person_group
|
|
* @property string|null $person_role
|
|
*/
|
|
class PodcastPerson extends Entity
|
|
{
|
|
/**
|
|
* @var Person
|
|
*/
|
|
protected $person;
|
|
|
|
/**
|
|
* @var array<string, string>
|
|
*/
|
|
protected $casts = [
|
|
'id' => 'integer',
|
|
'podcast_id' => 'integer',
|
|
'person_id' => 'integer',
|
|
'person_group' => '?string',
|
|
'person_role' => '?string',
|
|
];
|
|
|
|
public function getPerson(): ?Person
|
|
{
|
|
return (new PersonModel())->getPersonById(
|
|
$this->attributes['person_id'],
|
|
);
|
|
}
|
|
}
|