0 votes

ORMD 2.3.3.860, MVC: Symfony2, ORM: Doctrine2, Export to PHP annotations

Minor nuisance: When I "Export to ORM" annotations for associations which I have not changed seem to be regenerated. The problem is, there is an extra space in your export template which changes the definition line. Furthermore, since trailing spaces are forbidden by our coding standard and are checked upon commit, I need to review the changeset before commit and revert those changes. It's only affecting 10 entities up to now, but it could become a bigger problem.

Possible solutions:
1. Do not touch associations which have not changed.
2. Remove the trailing space from the definition line, as it is compliant with PSR-1.

Sample screenshot

P.S.: Sorry, I forgot the screenshot I did initially.

in Solved by (3.6k points)
recategorized by

I just did real quick and simple test of the behavior, and export works well in the basic setup. You can see screenshots:
model, export result and result code.

I understand it happens on specific entities only, not on your whole model. Could you send us some test case project where this behavior occurs? And the incorrectly exported PHP code so we have more detailed reference to fix this?

Please enable non printable characters in Notepad++ for the generated entity code and you will see that there is a trailing space in line 18 but most likely not in lines 10-12. In my experience, only the @ORM\JoinColumn annotation is affected.

It happens on all entities but only one or some annotations. I think it's limited to JoinColumn, but I am not sure. Or maybe it's only on many-to-many associations?!

If you still don't have the trailing slash in your exported PHP file, I will send you a minimal test case.

P.S.: I did a screenshot but unfortunately forgot to attach it to the initial report. See the OP for a screenshot that clarifies what I mean.

Thanks for the screenshot and the clarification. The problem happens only with many-to-many associations and we can induce it on our side. We can fix this now.

I just noticed another extra space:
http://i.imgur.com/6xFOZky.png
Does this have to be removed as well?

Hi Martin,

yes, thanks. That would be great!

1 Answer

+1 vote
Best answer

Hi Joern,

Ludek had fixed the export and removed the extra lines. There is new beta version ready for download here on support forum.

Please, check if the annotation export is now correct and let me know.

by Skipper developer (74.8k points)
selected by

Thanks! It works perfectly in 864.