HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/topswtw.komma.pro/vendor/sokil/php-isocodes/src/Database/Currencies.php
<?php

namespace Sokil\IsoCodes\Database;

use Sokil\IsoCodes\AbstractDatabase;
use Sokil\IsoCodes\Database\Currencies\Currency;

class Currencies extends AbstractDatabase
{
    /**
     * @return string
     */
    public static function getISONumber()
    {
        return '4217';
    }

    /**
     * @param array $entry
     *
     * @return Currency
     */
    protected function arrayToEntry(array $entry)
    {
        return new Currency(
            $entry['name'],
            $entry['alpha_3'],
            (int)$entry['numeric']
        );
    }

    /**
     * @return array
     */
    protected function getIndexDefinition()
    {
        return [
            'alpha_3',
            'numeric'
        ];
    }

    /**
     * @param string $code
     * @return null|Currency
     */
    public function getByLetterCode($code)
    {
        return $this->find('alpha_3', $code);
    }

    /**
     * @param int $code
     * @return null|Currency
     */
    public function getByNumericCode($code)
    {
        return $this->find('numeric', $code);
    }
}