# IsoCurrency.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2007-2008 by Dmitry E. Pismenny                         *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00012     final class IsoCurrency extends Enumeration
    00013     {
    00014         const RUB   = 643;
    00015         const USD   = 840;
    00016         const EUR   = 978;
    00017         const UAH   = 980;
    00018         const ILS   = 376;
    00019         const LVL   = 428;
    00020         const LTL   = 440;
    00021         const BYR   = 974;
    00022         const EEK   = 233;
    00023         const GBP   = 826;
    00024         const KZT   = 398;
    00025         const DKK   = 208;
    00026         const SEK   = 752;
    00027         const NOK   = 578;
    00028         const KGS   = 417;
    00029
    00030         protected $names = array(
    00031             self::RUB   => 'Russian Ruble',
    00032             self::USD   => 'US Dollar',
    00033             self::EUR   => 'Euro',
    00034             self::UAH   => 'Hryvnia',
    00035             self::ILS   => 'New Israeli Sheqel',
    00036             self::LVL   => 'Latvian Lats',
    00037             self::LTL   => 'Lithuanian Litas',
    00038             self::BYR   => 'Belarussian Ruble',
    00039             self::EEK   => 'Kroon',
    00040             self::GBP   => 'Pound Sterling',
    00041             self::KZT   => 'Tenge',
    00042             self::DKK   => 'Danish Krone',
    00043             self::SEK   => 'Swedish Krona',
    00044             self::NOK   => 'Norwegian Krone',
    00045             self::KGS   => 'Som'
    00046         );
    00047
    00048         protected $signs = array(
    00049             self::RUB   => 'руб.',
    00050             self::USD   => '$',
    00051             self::EUR   => '€',
    00052             self::UAH   => 'грн.',
    00053             self::ILS   => 'ILS',
    00054             self::LVL   => 'LVL',
    00055             self::LTL   => 'LTL',
    00056             self::BYR   => 'BYR',
    00057             self::EEK   => 'EEK',
    00058             self::GBP   => 'GBP',
    00059             self::KZT   => 'KZT',
    00060             self::DKK   => 'DKK',
    00061             self::SEK   => 'SEK',
    00062             self::NOK   => 'NOK',
    00063             self::KGS   => 'KGS'
    00064         );
    00065
    00069         public static function create($id)
    00070         {
    00071             return new self($id);
    00072         }
    00073
    00074         public static function getAnyId()
    00075         {
    00076             return self::RUB;
    00077         }
    00078
    00079         public function getSign()
    00080         {
    00081             return $this->signs[$this->id];
    00082         }
    00083     }
    00084 ?>