Yii2 demo database connection

Currently I have the following questions: how to make custom message such as "Database is not working on demo version." every time user is trying to perform actions related to the database (eg. DELETE, UPDATE SQL commands).




'db' => [

    'class' => 'yii\db\Connection',

    'dsn' => 'mysql:host=localhost;dbname=root',

    'username' => 'root',

    'password' => '',

    'charset' => 'utf8',

],



Maybe it will be cool to have something like this:




'db' => [

    'class' => 'yii\db\Connection',

    'dsn' => 'mysql:host=localhost;dbname=root',

    'username' => 'root',

    'password' => '',

    'charset' => 'utf8',

    'defaultDemoMessage' => 'Database is not working on demo version.'

    'demoCommands' => [

        'DELETE', 

        'UPDATE'

    ]

],



And when user will try to perform actions such as DELETE, UPDATE or whatsoever, he will receive the defaultDemoMessage

Or maybe there is an existing solution? If yes, could anybody suggest it?

Currently, I have done it using the exceptions inside of the main database class, but I think this is the not the way it is supposed to be. Thx in advance.

Anyone?

Extend yii\db\Connection and use your class for this component. Inside you can implement your solution and make it configurable just like in your example.