<?php #CodeGenerator V3 Δ 5b651871dcdd307edbc2599c1125ed46 Δ DYNAMICALLY GENERATED FILE - Do not modify this line! Remove it completely to protect the file from changes.
/**
 * Model Class
 *
 * @version     3.0.$Revision:$
 * @version     SVN: $Id:$
 * @version     STUB: 1.6.0
 * @generated   2026-05-27 10:03:40
 * @package     bplan-base/globals
 * @subpackage  Models
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 */

namespace BplanBase\Globals\Models;


use BplanBase\Globals\Models\TenantRecord;
use BplanBase\Globals\Observers\CountryObserver;
use BplanBase\Globals\Traits\HasActiveScope;
use BplanBase\Globals\Traits\HasOrderedScope;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;


/**
 * Model Class
 *
 * @version     1.0.0 / 2026-05-27
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
#[ObservedBy([CountryObserver::class])]
class Country extends Model
{


/* +++ TRAITS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */


    use HasActiveScope;
    use HasOrderedScope;


/* +++ CLASS CONSTANTS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     *
     */
    const CREATED_AT = null;
    /**
     *
     */
    const UPDATED_AT = null;


/* +++ OBJECT MEMBERS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     * The accessors to append to the model's array form.
     *
     * @var         array<int, string>
     *
     * @version     1.0.0 / 2026-05-27
     */
    protected $appends = [];


    /**
     * @var         array<string, string>
     *
     * @version     1.0.0 / 2026-05-27
     */
    protected $casts = [
        'active'            => 'boolean',
        'capital_names'     => 'object',
        'locales'           => 'array',
        'long_names'        => 'object',
        'nationality_names' => 'object',
        'short_names'       => 'object',
    ];


    /**
     * The attributes that are mass assignable.
     *
     * @var         array<int, string>
     *
     * @version     1.0.0 / 2026-05-27
     */
    protected $fillable = [
        'active',
        'area',
        'capital_names',
        'comments',
        'fips10',
        'ioc',
        'iso3166_alpha_2',
        'iso3166_alpha_3',
        'iso3166_numeric',
        'local_name',
        'locales',
        'long_names',
        'nationality_names',
        'nato_country_code_2',
        'nato_country_code_3',
        'short_names',
        'telephone_country_code',
        'telephone_country_code_extended',
        'tld',
        'vehicle_registration_code',
    ];


    /**
     * The attributes that aren't mass assignable.
     *
     * @var         array<int, string>
     *
     * @version     1.0.0 / 2026-05-27
     */
    protected $guarded = [];


    /**
     * The attributes that should be hidden for serialization.
     *
     * @var         array<int, string>
     *
     * @version     1.0.0 / 2026-05-27
     */
    protected $hidden = [];


    /**
     * The table associated with the model.
     *
     * @var         string
     */
    protected $table = 'countries';


    /**
     * Indicates if the model should be timestamped.
     *
     * @var         bool
     */
    public $timestamps = false;


/* +++ CLASS MEMBERS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ */


/* +++ OBJECT METHODS +++ +++++++++++++++++++++++++++++++++++++++++++++++++++ */


    /**
     *
     * @return      HasMany
     *
     * @version     1.0.0 / 2026-05-27
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function tenantRecords(): HasMany
    {
        return $this->hasMany(TenantRecord::class, 'country_id');

    } // tenantRecords()


/* +++ CLASS METHODS +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ */


} // class Country extends Model {}
