Let's say I have a class
class Item {
public function __construct($id) {
if(!empty($id)) {
$this->doSomethingWithID($id);
}
}
public function dummyMethod() {
//does Something.
}
protected function doSomethingWithID($id) {
//Does something with the ID
}
}
If I have an inherited class like this:
class Product extends Item {
public function __construct() {
parent::__construct();
}
protected function doSomethingWithID($id) {
//OVERRIDES THE PARENT FUNCTION
}
}
Will the Product class use the overridden Method? or will it use the Parent method?