I want to add additional stuff to the parent class. I can't modify the parent class because all modifications will be erased when the software is upgraded. So I want to extend the class. Can I just add this in the child class without repeating parent functions?
class parent
{
public function __construct()
{
// lots of logic to hook up following functions with main software
}
// lots of parent functions
}
class child extends parent
{
function __construct()
{
// Is this going to share parent's logic and hook up with those actions?
// Or, should I repeat those logics?
parent::__construct();
// add child addicional logic
}
// child functions
// should I repeat parent's functions? I need the parent take child along all the jobs.
}