contributte / nextras-orm-generator

:wolf: Rich Nextras\ORM entity generator for fast prototyping your new project.
https://contributte.org/packages/contributte/nextras-orm-generator.html
MIT License
20 stars 14 forks source link

Generating relationship parameter in entity #35

Closed krausv closed 1 year ago

krausv commented 1 year ago

Hi, thank for this amazing tool!

If I can have a question...

Is it possible to generate an entity without overwriting relationship?

Example:

I have some entity

/**
 * @property int $id {primary}
 * @property string|NULL $slug
 * @property CarClass|NULL $class {m:1 CarClass, oneSided=true}
 */
class Orders extends AbstractEntity
{
}

And if I add some new cols in db and re-run generator:

/**
 * @property int $id {primary}
 * @property string|NULL $slug
 * @property CarClass $class {??? CarClass::$???}
 * @property string|NULL $status
 */
class Orders extends AbstractEntity
{
}

Is possible somehow fix that?

Thanks for your reply!

f3l1x commented 1 year ago

Hi. Unfortunately it's not possible. This si simple library, that overrides all files. It would require some kind of parsing and it's too complex. If you use git, you can version your files and revert lines. :-)

krausv commented 1 year ago

Hi, thanks for your reply. It doesn't matter :-)