[Solved] How to add a custom attribute in the ORM export?

0 votes
asked Apr 4, 2019 in Solved by MarcDiaz (120 points)
recategorized Apr 6, 2019 by ludek.vodicka

Hi,

I want to add the Gedmo\Softdeleteable extension (https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/softdeleteable.md) to my entities with the attribute hardDelete set to false.

This attribute is not listed in Skipper, so I have added:

<attribute name="HardDelete" type="bool" help-text="A boolean to enable or disable hard delete after soft delete has already been done."/>

in Configurations/Extensions/Gedmo/GedmoExtension.skipper.cfg.xml.

The attribute is now shown in Skipper, which is good, but when I export the ORM, the attribute doesn't appear in the class annotation:

@Gedmo\SoftDeleteable(fieldName="deletedAt")

instead of

@Gedmo\SoftDeleteable(fieldName="deletedAt",hardDelete=false)

How can this be fixed?

Thank you in advance.

Marc Diaz

commented Apr 4, 2019 by ludek.vodicka Skipper developer (140,450 points)

Gedmo support isn't such straightforward like common ORM framework (unfortunately). It's because Gedmo is much more complicated because Gedmo puts annotations on several places.

Because of that a lot of logic has to be hardcoded also in export templates.

But don't worry, we can update it manually. We will add this attribute and let you know (I believe we will be able to release next beta today/tomorrow)

1 Answer

0 votes
answered Apr 4, 2019 by ludek.vodicka Skipper developer (140,450 points)

New beta with added "hardDelete" attribute is ready

Please download it here: https://support.skipper18.com/402/downloads-skipper-beta

Please let me know if it works as expected.

commented Apr 5, 2019 by MarcDiaz (120 points)

Great! The HardDelete is exported! Thank you!

Nevertheless, when I exit Skipper and start it again, each time I see an alert "Restore previous session state?". My version is the Linux one. It's not important, but I wanted you to know this little bug.

commented Apr 5, 2019 by ludek.vodicka Skipper developer (140,450 points)

I'm glad it's working now.

We didn't know about this issue on linux, thanks for info, we will check it.

...