Подскажите, пожалуйста)
Стараюсь писать на ООП:
системный класс
class SystemController{
public $db;
function __construct(){
$this->db = new systemDatabase();
}
}
класс базы данных
class systemDatabase extends PDO {
protected $connection = null;
public $countQuery;
public function __construct() {
parent::__construct(....);
}
public function query($sql){
$this->countQuery++;
return parent::query($sql);
}
}
контроллер
class someController extends SystemController{
function __construct(){
$this->model = new someModel();
}
function actionPage(){
$this->model->getListBooks();
}
}
модель
class someModel extends SystemController{
function getListBooks(){
$this->db->query(.....);
}
}
Почему в таком случае в классе someController доступна информация о количестве запросов в $this->model->countQuery, а в $this->countQuery результат пустой?
Как возможно исправить?
_____________
Одесса - мой город!)))