I am making a custom CMS and I created my base content class as follows:
class Content { public $title; public $description; public $id; static function save() { $q = "[INSERT THE DATA TO BASE CONTENT TABLE]"; } } class Image extends Content { public $location; public $thumbnail; public function save() {
My problem is that I know that a static function cannot use $this , but I know that it needs to use Content::save() .
I want Image::save() call Content::save() , but I wanted them to be named save() and declared public , not static , because I need $this .
Will the only solution be to rename Content::save() so that I can use it in Image::save() ?
Or is there a way to extend the methods?
source share