We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Generate ORM model from existing database?

Hello,

I am considering porting a new client's website to Phalcon. The current site is poorly coded and extremely insecure, but the database is reusable, so I intend to reuse the database exactly as is, and just port the shoddy, insecure PHP app layer to Phalcon.

Can Phalcon's ORM generate a model from an existing database? Phalcon's docs only talk about creating brand new models, unless I missed a part where it explains creating models from existing db's.

Thanks!



43.9k

Hi, quiet easy, use phalcon-devtools: https://github.com/phalcon/phalcon-devtools ~$ phalcon project my_project ~$ cd my-project ~$ phalcon all-models last command will generate all models for you