

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.
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.
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.
I hope you found this guide helpful in understanding Active Record in Yii2. XcelTec can help you with your projects by providing Virtual Developers.
Contact us on:- +91 987 979 9459 | +1 919 400 9200
Email us at:- sales@xceltec.com
how can we help you?