Тема: php ООП
Всім привіт!
Пробую писати ООП:
системний клас
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 результат пустий?
Як це можна виправити?
