In my class_lib.php in have defined a class
and set up a construct method like this:
By setting up the construct, does this mean that I don't have to set up the
set_ method in order to add properties ?
i.e. this isn't needed
I know this is basic, but I am just learning OOP :)
and set up a construct method like this:
Code:
<?php
class person {
var $name;
var $pinn_number;
public $height;
protected $social_insurance;
function __construct($persons_name) {
$this->name = $persons_name;
}
} // end class
?>
set_ method in order to add properties ?
i.e. this isn't needed
Code:
function set_name($new_name) {
$this->name = $new_name;
}