Tweeted twitter.com/StackSoftEng/status/979415419902623746
2 add new tag
| link
1
source | link

OOP PHP: How to avoid each class for each table situation

I am working on a project of an online service provider.

I have tables for admin, agent, customer and tables for data storage like city, services, category, sub-category, gender.

I have created classes for the admin, customer and agent. But should I create classes for city, services, category, etc or use as methods in admin, customer and agent.

note:- I want to perform CRUD operation for city, services, category, sub-category, gender tables.

Is it good to have one class for each table in a database? If not then please explain how to avoid this situation? Can I use enum or ArrayList instead of class for data storage?