Code generator plugin for PHP Data Objects (Value Object, DTO/Data Transfer Object, etc...) and Builder pattern objects for creating them.
The basic code generator for Data Objects and Builders are free and require no license. Just install the plugin. Advanced in-place refactoring of previously generated classes to add/remove class properties require a nominal one time fee to use after the 30-day trial.
- Generate new Data Objects by defining class properties.
- Generate Builder classes for your Data Objects.
- Modify templates used in generation.
- Ability to in-place refactor the Data Object and their Builders to add and remove properties.
- Select "Php Data Object" from the New File menu.
- Right Click > New > Php Data Object
- Fill in the dialog supplying classname and property definitions.
- Optionally select to make the class immutable (no "setter" methods will be generated).
- Optionally enable generating a Builder for the class.
- Select "Builder..." from the Generate menu
- Right Click in Editor view on PHP class > Generate > Builder...
- Define Builder classname and select which properties to include in the Builder.
- Open Project Preferences
- alt-. or command-.
- Within Preferences: Editor > File and Code Templates > "Other" tab > PHP Data Object Plugin
- Select "PHP DataObject Plugin"
- Edit templates as needed.
- Select "Update Data Object" from the Refactor menu
- Right Click in Editor view on PHP class > Refactor > Update Data Object
- Unselect any properties you wish to remove from the Existing Properties table.
- Define any properties you wish to add to the New Properties table.
Note: In-place refactoring will only function on data classes previously generated using this plugin.
Note: Making significant modifications to the included templates may cause the automatic refactoring to fail or produce otherwise unsatisfactory results. If you run into issues please submit a bug report with your template and example code.
Submit BugReports or Feature Requests: https://github.com/SourceLabOrg/PhpDataObjectGeneratorPlugin/issues
-
Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "Php Data Object Generator" > Install Plugin
-
JetBrains Market Place:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...