AR Model naming convention for 2 words and more

Hi all, I am still new to Yii.

I have database table names that have more than 1 word, and have used an underscore to name them as suggested in the guide e.g. table_name.

From the guide:

I would like to know if there is any naming convention for a AR model that represents a database table name with 2 words or more. camelback etc.


Yes, under_score is converted to the CamelCase when generating AR models. You could investigate a little bit more behavior of the Gii code generator. Some more examples:

tbl_news_item → NewsItem (tablePrefix is tbl_)

buyer_user → BuyerUser (tablePrefix is empty)

site_main_meal_category → MainMealCategory (tablePrefix is site_)