From: Verdon V. <ve...@ve...> - 2005-05-04 14:38:01
|
Hi :) Previously I've done a lot of serious hacking to other people's mods, I'm now in process of trying to write one of medium sophistication completely from scratch (well, more or less ;). One thing I'm not sure of is when I should make a class an extension of PHPWS_Item and when I should not, or if there is any hard-set rule. In my specific case, I am writing a mod that facilitates online petitions. I have written one class for the actual petitions, which does extend PHPWS_Item. I am now working on the class for signatures and it is that one that I am unsure of how to handle. The signatures are not items that will ever be directly manipulated by a logged in user, per say. Basically, an annon visitor can fill in a form to sign the petition. They will then get an e-mail with a link to click, which when they do so, the signature record is updated to indicate status as verified. At any time, an admin will be able to go in to the site and get stats on the number of verified signatures, print lists, and so on. So, I guess what I'm asking is, is there any hard-set rules as to when it is best to make a class an extension of PHPWS_Item or not? I've read through many core and 3rd party mods, and although I see some similarities in approach, I don't really see a pattern. TIA for any advice. Best regards from Northern Ontario, Canada, verdon vaillancourt |