0 votes

Why are the properties in the generated entity created in opposite order to that shown in the table view in Skipper? Can I control this?

in Solved by (310 points)
edited by

Not sure which properties do you mean. Can you post some screenshot and example of generated entity?

For example when editing the table in skipper I have the following fields

createdAt
updatedAt

when I export to ORM the generated entity (symfony2) has the properties in the opposite order like this

updatedAt
createdAt

However, even though they are at the end of the table in Skipper, they are placed in the middle of the other existing properties in the entity like so

/**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $transId;

    /**
     * @ORM\Column(type="datetime", nullable=false)
     * @Gedmo\Timestampable(on="update")
     */
    private $updatedAt;

    /**
     * @ORM\Column(type="datetime", nullable=false)
     * @Gedmo\Timestampable(on="create")
     */
    private $createdAt;

    /**
     * @ORM\Column(type="string", length=16, nullable=true)
     */
    private $postcode;

There doesn't seem to be any Rhyme nor reason to the order of the properties generated?

This is really strange, because fields should be ordered by model.

Only way how this should happen is when each field is created and exported after previous field was already exported. In such cases all new fields are added to the end of file.

But when I just tried create simple entity and select export, I have a correct output:

Example

Can you try to export it to empty folder to test if properties will be ordered correctly?

I have just done a test by deleting all the properties in the existing entity and then re-exporting from Skipper.

Here's the table:
enter image description here

And here is the resulting entity:

enter image description here

As you can see opposite order.

This is strange. Can you please send me your project to [email protected] so I can test it here?

Fixed in 3.1.2.1193 version (http://www.skipper18.com/en/download)

1 Answer

0 votes
Best answer

Fixed in 3.1.2.1193 version (http://www.skipper18.com/en/download)

by Skipper developer (141k points)