ticktackk / DeveloperToolsForXF2

This add-on provides enhancements for add-on developers.
MIT License
14 stars 7 forks source link

entity-class-properties should generate readonly property definitions for relationships and getters #122

Closed Xon closed 2 years ago

Xon commented 2 years ago

Similar to https://xenforo.com/community/threads/xf-dev-entity-class-properties-generates-phpdocs-which-indicate-readonly-properties-are-writeable.204571/

Readonly properties should be defined similar to this;

* COLUMNS
* @property string $name1_
* GETTERS
* @property string $name1
* @property-read string $name2
* RELATIONS
* @property-read string $name3

For relationships, an XF entity will reject updating a relationship property. For getters, unless it overshadows an existing column, it will reject updating a getter property.

ticktackk commented 2 years ago

@Xon can you take a look at the commit I pushed and see if it fixes the issue you are reporting?

Xon commented 2 years ago

Looks good!