pestle icon indicating copy to clipboard operation
pestle copied to clipboard

Add support for nested directories in CRUD model generation

Open adamonsoon opened this issue 8 years ago • 6 comments

Hey Alan!

I've been using pestle for a few days now and it's wonderful.

A feature I would love to have is the ability to use pestle magento2:generate:crud_model with Thing/OtherThing as the model argument.

It's sort of working as is, but requires a few manual changes to the created files. I could try and tackle it myself if you're okay with that at this stage of the development.

adamonsoon avatar Feb 26 '17 09:02 adamonsoon

@adamonsoon Good catch! A pul request would be super welcome! Any time frame on when you think you can get it done, or is this more a "when I can snatch a free moment" sort of thing?

astorm avatar Feb 27 '17 17:02 astorm

@astorm, I'll probably have some time on the weekend.

At first glance it looks like adding a modified version of getModelInterfaceShortName (and possibly others) which replaces forward slashes with back slashes could ~~do the trick~~ edit: be one of the required changes, now that I've looked at it a bit more closely.

adamonsoon avatar Feb 27 '17 22:02 adamonsoon

@adamonsoon Did you manage to steal some time to work on this last weekend? If not, do you mind if I tackle it this week?

astorm avatar Mar 06 '17 23:03 astorm

@astorm, I ended up getting sick and not doing much of anything. I don't mind if you tackle it. I'll submit a pull request with some other minor issues I've found when generating grid/form ui.

adamonsoon avatar Mar 06 '17 23:03 adamonsoon

Boooooooo germs. Hope you're feeling better soon!

astorm avatar Mar 06 '17 23:03 astorm

@adamonsoon Looks like I won't be able to get to this in this sprint -- it's a little trickier to implement that I thought (paths, namespace paths, etc. oh my!) so for this release I've added some validation code to pestle doesn't product invalid class file names

Still totally open to the idea of Thing/OtherThing created a model in a nest folder with an appropriate PHP namespace/classname. Happy to accept any pull requests along those line. Leaving issue open, detaching from this week's milestone.

astorm avatar Mar 11 '17 00:03 astorm