Skip to content
Snippets Groups Projects
Forked from Ad Aures / Castopod
930 commits behind the upstream repository.
AnalyticsPodcastsByRegion.php 709 B
<?php

/**
 * Class AnalyticsPodcastsByRegion
 * Entity for AnalyticsPodcastsByRegion
 * @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;

class AnalyticsPodcastsByRegion extends Entity
{
    protected $casts = [
        'podcast_id' => 'integer',
        'country_code' => 'string',
        'region_code' => '?string',
        'latitude' => '?float',
        'longitude' => '?float',
        'date' => 'datetime',
        'hits' => 'integer',
    ];

    public function getCountryCode()
    {
        return lang('Countries.' . $this->attributes['country_code']);
    }
}