HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/xedaptot/be.naniguide.com/app/Library/License.php
<?php

namespace Acelle\Library;

use Carbon\Carbon;

class License
{
    protected $license;
    protected $type;
    protected $supportedUntil;
    protected $status;
    protected $buyer;

    public const STATUS_ACTIVE = 'active';
    public const STATUS_INACTIVE = 'inactive';
    public const STATUS_EXPIRED = 'expired';

    public function __construct($license, $type, $status, $supportedUntil, $buyer = null)
    {
        $this->license = $license;
        $this->type = $type;
        $this->supportedUntil = Carbon::parse($supportedUntil);
        $this->status = $status;
        $this->buyer = $buyer;
    }

    public function isActive()
    {
        return $this->status == self::STATUS_ACTIVE;
    }

    public function isInactive()
    {
        return $this->status == self::STATUS_INACTIVE;
    }

    public function isExpired()
    {
        return $this->status == self::STATUS_EXPIRED;
    }

    public function getLicenseNumber()
    {
        return $this->license;
    }

    public function getType()
    {
        return $this->type;
    }

    public function getSupportedUntil($timezone = null)
    {
        if (is_null($timezone)) {
            return $this->supportedUntil;
        } else {
            return $this->supportedUntil->timezone($timezone);
        }
    }

    public function getBuyer()
    {
        return $this->buyer;
    }
}