Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.3.1

Request #11209 Make options's visibility protected
Submitted: 2007-06-02 20:39 UTC
From: wiesemann Assigned: avb
Status: Closed Package: HTML_Common2 (version 2.0.0beta1)
PHP Version: 5.2.2 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-06-02 20:39 UTC] wiesemann (Mark Wiesemann)
Description: ------------ I'd like to get away from several setter/getter methods in HTML_Table2. Instead of e.g. having methods setAutoGrow()/getAutoGrow(), it would be nice to use the $_options array. This would allow me to pass values (not 'autoGrow', but e.g. 'autoFill') to the various instances of the storage class. Would you be willing to rename $_options to $options and to mark is as protected? (A protected getOptions() method would be another solution.) Multiple getOption() calls don't seem like a clean solution to me.

Comments

 [2007-07-06 09:07 UTC] mansion (Bertrand Mansion)
I wouldn't mind having getIndent() a public method as well.
 [2009-04-03 22:46 UTC] avb (Alexey Borzov)
-Status: Open +Status: Analyzed
Looks like we already have protected $options in HTML_QuickForm2_Element_Select_OptionContainer, so it won't be a good idea to make the field protected in HTML_Common2 On the other hand, I can change getOption() to just return the array of options if no $name is given. That'll be enough, I suppose.
 [2009-04-07 02:34 UTC] wiesemann (Mark Wiesemann)
Although I don't have any plans on HTML_Table2 anymore (there wasn't much interest after annoucing its development), your suggestion is fine with me. It might be a little "weird" to have getOption() (singular) return an array of options (plural), though. Maybe you want to consider to add a new getOptions() method (c.p. my original request).
 [2009-09-27 12:26 UTC] avb (Alexey Borzov)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: avb
Implemented in release 2.0.0RC1