RE: [PHP] oo question
| From: | Chris W. Parker | Date: | Mon, 19 Apr 2004 22:46:58 +0000 |
| Subject: | RE: [PHP] oo question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-183884@lists.php.net to get a copy of this message | ||
Kelly Hallman <mailto:khallman@ultrafancy.com>
on Monday, April 19, 2004 12:34 PM said:
> I think what you're talking about here is encapsulation.
in that case what is abstraction?
>> PROPOSED CHANGE:
>> class Customer {
>> ...
>> function initialize_customer($customer_id) {
>> // grab data from db
>> $this->fname = $...[0]['fname'];
>> $this->lname = $...[0]['lname'];
>> $this->age = $...[0]['age']; }
i see my code has been run through the kellytron 5000. ;)
> class Customer {
>
> var $res = array();
what does $res stand for? result?
> var $id, $fname, $lname;
>
> function Customer($id=null) {
> $id === null || $this->initCustomer($id); }
what is the above line equivalent to and why is '$id == null' not
sufficient?
> My point: it's redundant to have $obj->fname and $obj->firstName(),
> and may encourage mixing the way you access the object data from your
> code, which could potentially defeat the purpose of the get/set
> method.
i see what you mean.
thanks,
chris.