I would prolly do something like this (maybe ;) depending on the situation...
where 0 is false (or don't get this var), and
1 is true (or get this var)
function get_somevars( getvar1 = 0, getvar2 = 0, getvar3 = 0) {
...
}
we don't get any by default, and the ones that we do want we pass the function 1 values like so...
get_somevers(1, 0, 1); // or get var1 and var3 but don't get var2
HTH,
Matt
At 04:42 PM 11/1/2002 -0500, you wrote:
Hi every1 This is a theorical question about the best way to use classes.I have a class named anything, and also theres a table named ahything .. The class attributes are the same fields of the table like this Class anything { var $something1; var $something2; var $something3; } And the table 'anything' has 3 fields they are something1 , something2, something3, my question: I have a method in the class that retrieves the values for the 3 attributes from the table, there are many scripts that use this method to get the data, but not all the scripts uses the 3 attributes, for example a script calls the method just because only needs the attribute something1. should i write one method to retrieve each attribute ? Or is just fine that one method gets all data, and the scripts only uses what it needs ?? Of course, the real class has more than 3 attributes it has 10 attributes Thanks Any help would be very useful. Daniel. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php