class MySQL
{
public function connect()
{
// code...
}
}
class Page
{
protected $mysql = null;
public function __constuct()
{
$this->mysql = new MySQL;
}
public function view($id)
{
$this->mysql->where($id);
}
public function delete($id)
{
$this->mysql->delete($id);
}
}
$page = new Page;
$page->view($id);
$page->delete($id);