You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/generator/postProcessor.rst
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,8 @@ Now let's have a look at the behaviour of the generated model:
79
79
80
80
If the **PopulatePostProcessor** is added to your model generator the populate method will be added to the model independently of the `immutable setting <../gettingStarted.html#immutable-classes>`__.
81
81
82
+
The **PopulatePostProcessor** will also resolve all hooks which are applied to setters. Added code will be executed for all properties changed by a populate call.
83
+
82
84
AdditionalPropertiesAccessorPostProcessor
83
85
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84
86
@@ -163,3 +165,15 @@ A custom post processor which adds a custom trait to the generated model (eg. a
163
165
.. hint::
164
166
165
167
For examples how to implement a custom post processor have a look at the built in post processors located at **src/SchemaProcessor/PostProcessor/**
168
+
169
+
What can you do inside your custom post processor?
170
+
171
+
* Add additional traits and interfaces to your models
172
+
* Add additional methods and properties to your models
173
+
* Hook via SchemaHooks into the generated source code and add your snippets at defined places inside the model:
174
+
175
+
* Implement the **ConstructorBeforeValidationHookInterface** to add code to the beginning of your constructor
176
+
* Implement the **ConstructorAfterValidationHookInterface** to add code to the end of your constructor
177
+
* Implement the **GetterHookInterface** to add code to your getter methods
178
+
* Implement the **SetterBeforeValidationHookInterface** to add code to the beginning of your setter methods
179
+
* Implement the **SetterAfterValidationHookInterface** to add code to the end of your setter methods
Copy file name to clipboardExpand all lines: docs/source/gettingStarted.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ Immutable classes
147
147
148
148
setImmutable(bool $immutable);
149
149
150
-
If set to true the generated model classes will be delivered without setter methods for the object properties. By default the classes are generated without setter methods.
150
+
If set to true the generated model classes will be delivered without setter methods for the object properties. By default the classes are generated without setter methods. Each setter will validate the provided value and throw either a specific exception or a collection exception depending on the `error collection configuration <#collect-errors-vs-early-return>`__. If all validations pass the internal value will be updated as well as the value which will be returned when `getRawModelDataInput` is called.
0 commit comments