MonetaryBundle

35 views
Skip to first unread message

IamPersistent

unread,
Apr 8, 2011, 5:16:22 AM4/8/11
to vespol...@googlegroups.com
As some of you might know, I've been working on a MonetaryBundle to help handle the monetary values and the ability to assign currencies and do exchanges between currencies.  

I have decided to put the currency data into a single file.  I've started with the the ISO 4217 http://www.currency-iso.org/iso_index/iso_tables/iso_tables_a1.htm table, modifying their tag names.

The symbol for the currencies are not included in the table.  At some point, we should be using internationalization to format the currencies.  The intl PECL package can handle that, but some mac users have had problems installing it.  I feel like we would be better off to at least have a default symbol in place. Since those symbols will have to be manually added to the currencies.xml file, I would love to get some help on this.  You can use this wikipedia page http://en.wikipedia.org/wiki/ISO_4217 and follow the links to get the symbol.  I have done the first few to have an example.

If you want to help, just fork vespolina and start a currency branch.  When you've made some changes, put in a pull request.  It would probably be a good idea to announce on the list what part of the table you are working on so we don't get duplicated work.

Richard


IamPersistent

unread,
May 11, 2011, 11:10:23 AM5/11/11
to vespol...@googlegroups.com
I just put in a pull request for the MonetaryBundle.  It has complete tests and everything is passing.  Look over it, provide feedback.

Thanks
Richard

Inspiran

unread,
May 12, 2011, 4:03:34 PM5/12/11
to vespolina-dev
I've had a look at it Richard. Great work!

Just some small remarks/questions:

* In method getCode of class CurrencyExchanger I notice an instanceof
statement. Isn't it possible to specify the interface already in the
method signature? Something like getCode(Vespolina\MonetaryBundle
\Model\CurrencyInterface $currency{ ...
* In method getExchangeRate of class GoogleCurrencyExchanger $this-
>getCurrency() is called. Where is getCurrency defined? I am not
able to find it (neither in GoogleCurencyExchanger and
CurrencyExchanger).

Richard Shank

unread,
May 12, 2011, 5:28:27 PM5/12/11
to vespol...@googlegroups.com


On May 12, 2011 1:03 PM, "Inspiran" <dan...@xerias.be> wrote:
>
> I've had a look at it Richard.   Great work!
>
> Just some small remarks/questions:
>
> * In method getCode of class CurrencyExchanger I notice an instanceof
> statement.  Isn't it possible to specify the interface already in the
> method signature?  Something like getCode(Vespolina\MonetaryBundle
> \Model\CurrencyInterface $currency{ ...

I wanted to allow look up using the ISO not just a currency instance

> * In method getExchangeRate of class GoogleCurrencyExchanger $this-
> >getCurrency() is called.  Where is getCurrency defined?  I am not
> able to find it (neither in GoogleCurencyExchanger and
> CurrencyExchanger).

Yeah, I must have changed method names at some point.  It should be good now. Obviously, I don't tests for it. I'll need to do that.

Reply all
Reply to author
Forward
0 new messages