Re: PROPOSAL: Contact_Vcard_Build
| From: | Paul M Jones | Date: | Thu, 03 Apr 2003 21:02:02 +0000 |
| Subject: | Re: PROPOSAL: Contact_Vcard_Build | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14861@lists.php.net to get a copy of this message | ||
On Thursday, Apr 3, 2003, at 14:46 US/Central, Martin Jansen wrote:
On Thu, 2003-04-03 at 20:00, Paul M Jones wrote:That was my first inclination as well. However, I ran into trouble when trying to come up with a useful way to differentiate NAME (the name of the data source) from N (the entity-name). Using setDataSourceName() and setName() ended up confusing me when I was looking back-and-forth between the RFC 2426 and the class, especially when checking the generic add/set/get methods (which take the typedef as an argument, not the longer descriptive name). I ended up deciding the best route was to mimic the RFC as closely as possible; that way, you can tell at a glance exactly which vCard typedef you're working with. The only place I depart from the RFC substantially is with SORT-STRING (can't have a dash in a function name -- used SORT for the method name but kept 'SORT-STRING' as the typedef key). However, if I am off-base about this and you all think using the longer descriptive names is better, I can make the switch easily enough. Thanks for the pointers. :-) -- pmjAs a companion class to Contact_Vcard_Parse, I propose Contact_Vcard_Build. This class builds version 2.1 and 3.0 vCards. You can see the documentation and download the class file here:Looks fairly cool, but I suggest to change the method names a bit. Examples: addADR() -> addAddress() addEMAIL() -> addEmail() setFN() -> setFormattedName()http://ciaweb.net/free/contact_vcard_build/