class grandparent extends ActiveRecord{
public function setvalue(){
$this->grandparent_column1 = "abc";
}
}
class parent extends grandparent{
public function setvalue(){
parent::setvalue();
$this->parent_column1 = "def"
}
}
class child extends parent{
public function setvalue(){
parent::setvalue();
$this->child_column1 = "xyz";
}
}
$child_object = new child();
$child_object->setvalue;
echo $this->child_column1;
echo $this->parent_column1;
echo $this->grandparent_column1;
class GrandParentClass
{
public $grandparent_column1;
public function setvalue()
{
$this->grandparent_column1 = "abc";
}
}
class ParentClass extends GrandParentClass
{
public $parent_column1;
public function setvalue()
{
parent::setvalue();
$this->parent_column1 = "def";
}
}
class ChildClass extends ParentClass
{
public $child_column1;
public function setvalue()
{
parent::setvalue();
$this->child_column1 = "xyz";
}
}
$childObject = new ChildClass();
$childObject->setvalue();
echo $childObject->child_column1;
echo $childObject->parent_column1;
echo $childObject->grandparent_column1;
I highly suggest you to learn about PHP & OOP basics first.
Or at least follow some basic tutorials.
You find plenty with google just look for "PHP OOP Beginner Tutorials".