Active Record is database access and manipulation tool that uses an object-oriented interface. An Active Record class is linked to a database table, an Active Record instance is linked to a table row, and an attribute of an Active Record instance is linked to the value of a specific column in that row. To access and alter the data stored in database tables, you would access Active Record properties and invoke Active Record methods instead of writing raw SQL commands.
What is Yii2's character?
The Yii base Behavior class is used to create behaviours. A behaviour attaches itself to a component and injects its methods and properties into it. Behaviour patterns can also react to the events that the component has caused.
What should you do if a Yii DB exception is thrown?
Sets a callable (e.g., an anonymous function) that is called when the yii\\db\\Exception is thrown during the command execution. The callable’s signature should be: The default fetch mode for this command is the DB connection with which it is linked.
For data access, Active Record provides an object-oriented API. A database table is connected with an Active Record class.