abstract class Table_Abstract
{
abstract public function getSize();
abstract public function getName();
abstract public function getWeight();
public function getAboutTable()
{
$info = 'size: ' . $this->getSize();
$info .= 'name: ' . $this->getName();
$info .= 'weight: ' . $this->getWeight();
return $info;
}
}
class TableWood extends Table_Abstract
{
public $size;
public $name;
public $weight;
public function __construct($size, $name, $weight)
{
$this->size = $size;
$this->name = $name;
$this->weight = $weight;
}
public function getSize()
{
return $this->size;
}
public function getName()
{
return $this->name;
}
public function getWeight()
{
return $this->weight;
}
}
$table_wood = new TableWood('200x200', 'wood table', '200т');
echo $table_wood->getAboutTable();