Imagine you have a list of some objects. These objects are instances of various classes which are extending a base class. 
Now I'd like to save these objects in a database.

As an additional requirement, the number of classes which extends the base class can be quite big.

Is it good practice to save the class name as string in the database and fetch it like that:

```
<?php
class Page {
    abstract public function foo($args);
}

class ChartPage : Page{
    public function foo($args){
        var_dump($args);
    }
}

// other classes like ChartPage would be defined here

// fetched row from a MySQL database
$row = array("id" => 21, "title" => "Test", "class" => "ChartPage", "args" => "{}");
$object = new $row['class'];
$object->foo($row['args']);
?>

```

Are there any practices to do anything like that in a better way?