2020-06-12 20:41:09 +00:00
|
|
|
<?php
|
2020-08-04 11:25:22 +00:00
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-06-12 20:41:09 +00:00
|
|
|
/**
|
2021-05-19 16:35:13 +00:00
|
|
|
* Class AnalyticsPodcastsByRegion Entity for AnalyticsPodcastsByRegion
|
|
|
|
*
|
2022-02-19 16:06:11 +00:00
|
|
|
* @copyright 2020 Ad Aures
|
2020-06-12 20:41:09 +00:00
|
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
|
|
* @link https://castopod.org/
|
|
|
|
*/
|
2020-08-04 11:25:22 +00:00
|
|
|
|
2021-08-23 11:05:16 +00:00
|
|
|
namespace Modules\Analytics\Entities;
|
2020-06-12 20:41:09 +00:00
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
use CodeIgniter\Entity\Entity;
|
2020-06-12 20:41:09 +00:00
|
|
|
|
2021-05-12 14:00:25 +00:00
|
|
|
/**
|
|
|
|
* @property int $podcast_id
|
|
|
|
* @property string $country_code
|
|
|
|
* @property string|null $region_code
|
|
|
|
* @property double|null $latitude
|
|
|
|
* @property double|null $longitude
|
|
|
|
* @property Time $date
|
|
|
|
* @property int $hits
|
|
|
|
* @property Time $created_at
|
|
|
|
* @property Time $updated_at
|
|
|
|
*/
|
2020-10-06 15:39:27 +00:00
|
|
|
class AnalyticsPodcastsByRegion extends Entity
|
2020-06-12 20:41:09 +00:00
|
|
|
{
|
2021-05-12 14:00:25 +00:00
|
|
|
/**
|
|
|
|
* @var string[]
|
|
|
|
*/
|
|
|
|
protected $dates = ['date', 'created_at', 'updated_at'];
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
/**
|
|
|
|
* @var array<string, string>
|
|
|
|
*/
|
2020-06-12 20:41:09 +00:00
|
|
|
protected $casts = [
|
|
|
|
'podcast_id' => 'integer',
|
|
|
|
'country_code' => 'string',
|
2020-10-06 15:39:27 +00:00
|
|
|
'region_code' => '?string',
|
2021-05-12 14:00:25 +00:00
|
|
|
'latitude' => '?double',
|
|
|
|
'longitude' => '?double',
|
2020-06-12 20:41:09 +00:00
|
|
|
'hits' => 'integer',
|
|
|
|
];
|
2020-10-14 10:38:48 +00:00
|
|
|
|
2021-05-14 17:59:35 +00:00
|
|
|
public function getCountryCode(): string
|
2020-10-14 10:38:48 +00:00
|
|
|
{
|
|
|
|
return lang('Countries.' . $this->attributes['country_code']);
|
|
|
|
}
|
2020-06-12 20:41:09 +00:00
|
|
|
}
|