Skip to content

feat: add shield:model command - #558

Merged
datamweb merged 7 commits into
codeigniter4:developfrom
paulbalandan:shield-model-spark
Jan 5, 2023
Merged

feat: add shield:model command#558
datamweb merged 7 commits into
codeigniter4:developfrom
paulbalandan:shield-model-spark

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Supersedes and closes#491

@kenjiskenjis added the enhancement New feature or request label Dec 13, 2022
Comment threaddocs/concepts.md Outdated

@MGatnerMGatner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming it MyUserModel means that factories won't pick it up automatically when searching for UserModel. This seems a loss to me, maybe not for the library itself but for any supporting code.

@kenjis

Copy link
Copy Markdown
Member

UserModel instead of MyUserModel seems better for the default sample.
There is no need to prefix My.

@kenjis

Copy link
Copy Markdown
Member

Oh, I get an error if I specify UserModel. It's a bug.

@lonnieezelllonnieezell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried with UserModel as the generated filename, I think the only issue was the class name conflict. I've made suggestions here to fix that in the code (though not the docs).

I think this will fix @MGatner concerns, which I agree with.

Other than that, my only suggestion might be to provide a default classname at the cli prompt.

Comment threadsrc/Commands/Generators/Views/usermodel.tpl.php Outdated
Comment threadsrc/Commands/Generators/Views/usermodel.tpl.php Outdated
Comment threadtests/Commands/UserModelGeneratorTest.php Outdated

@MGatnerMGatner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run this but the code looks good. Thanks for making that change.

@lonnieezelllonnieezell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for taking this one over.

Comment threadsrc/Commands/Generators/UserModelGenerator.php Outdated
@datamweb

Copy link
Copy Markdown
Collaborator

It's a bug.

@kenjis waiting for you. Did your worries go away?

Comment threadsrc/Commands/Generators/UserModelGenerator.php Outdated

@kenjiskenjis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@datamwebdatamweb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all.

@datamweb
datamweb merged commit aba50df into codeigniter4:developJan 5, 2023
@paulbalandan
paulbalandan deleted the shield-model-spark branch January 5, 2023 15:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@paulbalandan@kenjis@datamweb@lonnieezell@MGatner