HEX
Server: LiteSpeed
System: Linux server.zepintelhosting.com 4.18.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User: enamadmin (1026)
PHP: 8.2.30
Disabled: exec,system,passthru,shell_exec,proc_open,popen,apache_child_terminate
Upload Files
File: /home/enamadmin/public_html/aaelearningb/lib/maxmind/GeoIp2/Record/Continent.php
<?php

declare(strict_types=1);

namespace GeoIp2\Record;

/**
 * Contains data for the continent record associated with an IP address.
 *
 * This record is returned by all location services and databases.
 */
class Continent extends AbstractNamedRecord
{
    /**
     * @var string|null A two character continent code like "NA" (North
     *                  America) or "OC" (Oceania). This attribute is returned by all location
     *                  services and databases.
     */
    public readonly ?string $code;

    /**
     * @var int|null The GeoName ID for the continent. This
     *               attribute is returned by all location services and databases.
     */
    public readonly ?int $geonameId;

    /**
     * @ignore
     */
    public function __construct(array $record, array $locales = ['en'])
    {
        parent::__construct($record, $locales);

        $this->code = $record['code'] ?? null;
        $this->geonameId = $record['geoname_id'] ?? null;
    }

    public function jsonSerialize(): array
    {
        $js = parent::jsonSerialize();
        if ($this->code !== null) {
            $js['code'] = $this->code;
        }
        if ($this->geonameId !== null) {
            $js['geoname_id'] = $this->geonameId;
        }

        return $js;
    }
}