Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFR : Generate entity with CLI #330

Open
lcetinsoy opened this issue Apr 17, 2015 · 1 comment
Open

NFR : Generate entity with CLI #330

lcetinsoy opened this issue Apr 17, 2015 · 1 comment

Comments

@lcetinsoy
Copy link

Currently the only way to generate model is by setting the sql database structure (by raw sql, phpmyadmin, etc) and running phalcon model. However it is error prone, neither convienent nor fast. A more efficient tool would allow to generate the php class and updating the schema based on the class metatada so that sql database is updated for you.

It would works like that :

$ phalcon create-model --name=myName
new attribute name:
$firstName
type:
$string
length(255):
$44
new attribute name:
etc.

This feature exists in sf2 cli. It is based on doctrine2 cli tools. If I am not wrong, sf2 process works as follow : the command line update the meta data then generates the php class based on that.

A first implementation could be done by integrating the sf2 part in charge of updating the database schema and then generates the class using phalcon model.

The next step would be to mimic the sf2 approach by defining the schema in the php class and updating schema based on metadata in the class. Updating entities would be done in a single step and a single file. Besides, deployment would be eased by requiring only to run phalcon database:update on the server after file upload.

I will try to do so tests and see if sf2 tool parts can be easily integrated with phalcon ones.

I think that cli tools is an important part for the adoption of a framework and must let the dev concentrate on dev by abstracting away administration as much as possible.

Kind regards.

@KoriSeng
Copy link
Contributor

have to confirm something first, there's 3 way to go about this.

1: Make changes to the current builder/command
2: Make new builder/command
3: Make new builder/add additional parameter to command.

@Jeckerson Jeckerson added this to the 4.0.0 milestone Mar 15, 2019
@Jeckerson Jeckerson modified the milestones: 4.0.0, 4.1.0 Nov 10, 2019
@Jeckerson Jeckerson self-assigned this Jan 1, 2020
@Jeckerson Jeckerson modified the milestones: 4.0.x, 5.0.x Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants