![]() In the following example, we declare an Active Record class named Customer for the customer database table. The brackets around the table name are used for TablePrefix is tbl_, Customer becomes tbl_customer and OrderItem becomes tbl_order_item. You may override this method if the table is not named after this convention.Īlso a default tablePrefix can be applied. The tableName() method returns the table name by converting the class name via yii\helpers\Inflector::camel2id(). Setting a table name ¶īy default each Active Record class is associated with its database table. To get started, declare an Active Record class by extending yii\db\ActiveRecord. However, most content described here are also applicable to Active Record for NoSQL databases. ![]() In this tutorial, we will mainly describe the usage of Active Record for relational databases.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |