| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Comments:
<0> Bungopolis: hold on... no, that's not the idea!! <1> hehe <0> Bungopolis: you should be calling super cl*** constructor, not overriding vars <0> Bungopolis: if you rely on overriding member vars in extended cl***es it is terrible to maintain <1> right, it makes sense I think I'll start doing that too <2> wouldn't that echo an error? <2> would it be right if I put an IF in constructor? <2> or is that wierd, or not right? <0> Frosh: you can put any code you want in a constructor!! <2> wait I never understand __get or __set <2> what's the real point? <2> can't you write your own method to function the same as __get and __set <1> yes <1> frosh its just for lazy people, I think its bad practice in general <0> Frosh: good OO design dictates that you should not access member vars outside a cl***, but implementing get/set functions can be a h***le (see: Java) <1> frosh it could be useful for a cl*** that is an active record for a databsae scheme that could change or we dont know
<0> Frosh: but i don't use anything with __ in front except autoload because it looks really ugly <3> algum fala portugus? <4> NAMD-NSH: No. <3> thanks <1> somente com o proxy em linha <3> o nivel do pessoal aqui bem elevado <3> serve muito para iniciantes <1> eu sou um pato grande - examine por favor minha rvore de alperce <5> so apparently... don't ask questions about php <5> or you might get banned <5> ??? <6> hi, is there a function to strip new lines and stuff? <5> aapinne: don't get too invasive, ya might get banned :) <6> lol <6> yeah right <6> what were you guys talking about? <5> sorry, I'm thinking of the EFnet :) <5> heh, that's what just happened to me on there. <7> how can i go about getting php to print into a div containter, and then adding text depending on some if statements? <8> dools: sorry for not replying ... was called away <5> I asked a question about php having everything in a cl*** needing a $this-> in front of it, and what that is when it seems implicit in other languages, and I got banned :) <8> dools: not entirely sure how/what the .NET remoting actually does other than object serialization/deserialization and execution <6> lol iamghetto <8> dools: it also looks like it handles IPC and RPC <6> coding php is a crime <4> coding crime in PHP is a crime. <2> me puts eerything in __construct <2> :D <2> byte me. <6> how do you code crime in PHP? <9> hi all <6> hi <9> does anyone have alink to a page explaining basic operators like += ect <6> http://be.php.net/manual/en/language.operators.php <6> there you are <6> and what would you like Santa to bring this year? :p <9> indeed <2> lol...wonder if this works...putting everything in the constructor <2> lol <6> Frosh, you're such a risk taker <9> if santa is good at php, he can sort out this god damn online shop 4 me <9> its driving me crazy <0> haha <2> why ask santa, if you can ask God? <6> lol <6> God ?? Who's that? <9> haha either will do <6> online shop in what? <9> Im trying to change this affiliate code from a percentage to a one off payment and I have only done a little bit of php! ;-) <9> so today is going to be a fun day <9> :-) <6> haha <6> i wish you luck Razz3r (and maybe we all should get the hell out of here then) <2> when would you actually extend a cl***? <2> I think I'm about to extend for the wrong reason :D <9> thanks my friend <8> Frosh: you'd mainly extend from a cl*** if the cl*** your extending from has properties / methods that are common <8> Frosh: eg I'd create a person cl*** containing a firstname/lastname and then create a user cl*** that extends from the person clas <8> make sense? <6> parent/child stuff <9> what does -> operator do?
<6> it is used to call a method <8> Razz3r: it's called the accessor <9> ah right I get it <2> hmm <2> the child cl*** is not really related to the parent <9> Im just goignt o write out the code into logical english, a kind of psudo code <2> but I wouldn't mind the variables p***ing down to the child <8> Razz3r: to add to aapinne's comment ... it's can also be used to access properties of a cl*** <8> Frosh: they do <8> Frosh: because a user is a person right? <6> true true <2> yea in your example <8> Frosh: a user still has a firstname and a last name <2> I was refering to my example <8> lol <8> Frosh: give me an example <2> http://pastebin.com/645661 <2> it's not complete <9> if I pastebin the code could one of you guys take a look to see how hard it is to modify and take out the percentage and give out a one of standard payment <2> I prolly broke some kind of coders rule by what I just did. <9> http://pastebin.com/645659 <8> Frosh: so which cl*** do you plan on extending? <2> the bottom part <2> tv_display <2> it needs the variable from math_clss <8> so extending tv_display from Math Cl***? <2> yea <2> Math Cl*** parent <6> uhm, why? just to get the Variables? <2> tv_display child <2> maybe I should combine them <2> but I was just wondering <8> Razz3r: you not wanting the calcs to take into account a percentage? <6> i don't see the point of using inheritance here <8> Aapinne: I agree <2> So what is your recommendation? <2> one cl***? <8> Frosh: what are you wanting to achieve? <9> psykick: no all I want to do is give out a one of payment of say rather then a percentage <2> ? $affiliate_commission = $db->Execute("select affiliate_commission_percent from " . TABLE_AFFILIATE . " where affiliate_id = '" . $affiliate_ref . "'"); <6> just use gets/ eg: in Math: a function for example public function getLowTime(){ return $this->low_timea;} <9> psykick: I would be happy keeping the variable names the same because I will probably end up going back to that system one ths shop is running established <2> then I have alot of methods? <8> Razz3r: well you could just change line 21 to read: $affiliate_payment = zen_round($affiliate_total + 5, 2);; <6> uhm, who is helping who here? <2> would that be good to have tons of methods? <9> haha <6> only relevant ones of course <9> is that the only change that is required baring in mind it is only a temporary change? <10> blah, http://rafb.net/paste/results/hR5Sxw51.html - for some reason, my if-block inside fetch_depend() isn't being triggered (the "Hey, no rows returned!" if-block). <0> Frosh: think OO as real world <8> Frosh: you really have 2 options <2> 2 options only? <9> Psykick: sorry that was aimed at you <8> Frosh: you could make the math cl*** global and call it from with functions <6> I learned OOP in Java first, and i think you should be able to get EVERY datamember from a cl***, only NOT if you have a good reason <8> Razz3r: well that would at least just add 5 pounds to the final total <0> Frosh: sometimes you go backwards, like you have a bunch of components and notice that they share soemthing in common, so you create a base cl*** for future maintainability. the major reason to extend a cl*** is maintainability, especially when using external libraries <9> Psykick: so it wont create any problems with other calculations in the code? <8> Frosh: the other option .... bit messy would be to create a private variable in the tv cl*** and create and ***ign an instance of the math cl*** to that private variable <2> come to think of it, i don't need an extra cl***...just combine them in one cl*** with two methods <8> Razz3r: that should be the only change <6> just use functions to GET priv datamembers <9> Psykick: I was hoping that it was goint to be as simple as that but I thought I should ask someone who knows that they are doing with php before doing it <8> Razz3r: you could potentially comment out lines 19 and 20 as well <8> Razz3r: any well versed coder knows that you make backups before changing anything <8> or make a copy of the line or comment it out before changing it <8> Razz3r: so you can at least revert back if things don't go as planned <2> http://pastebin.com/645671 any way to shorton this, line 2 and 7 is the same, so one extra condition, weird <0> Frosh: but imagine cl*** ElectricalComponent which has property power supply and method turnOn(), then you have Television that extends ElectricalComponent, and adds the method changeChannel() with an abstract method getDisplay(), then you have CrtTelevision which inherits from Television and overrides getDisplay() by returning a new CrtDisplay(); object, where as PlasmaTelevision's getDisplay method returns PlasmaDisplay() as the display object. the other key to <0> thus ends my dissertation on OO :-) <9> Psykick: yer I was going to keep those lines and enter 5 under the percent rate i.e. (($affiliate_total + $affiliate_percent), 2); <6> Nice Dools
Return to
#php or Go to some related
logs:
libgl total annihilation persistent perl 64 bit ubuntu #web nytr8 845GM Fedora
Fatal error: Call to undefined method PEAR_PackageFile_v1 subtitle2pgm dapper missing gnome what shortcuts 0xec debian what provides dpkg ioctl(SIOCGIFINDEX): No such device gentoo
|
|