When beans and DAOs PHP files are generated by TDBM a number of events are triggered. You can hook on these events to add some specific code.
A few possible use cases:
MoufDiListener
class does precisely that)There are 2 interfaces you can implement to react on code generation.
GeneratorListenerInterface
if you want to get a list of all beans/DAOs generated.
This is useful if you want to auto-generate a container for instanceCodeGeneratorListenerInterface
if you want to alter generated code.
For instance, the thecodingmachine/tdbm-graphql package uses this listener to add annotations directly
in the beans.Instances of GeneratorListenerInterface
and CodeGeneratorListenerInterface
must be referenced in the Configuration
object.
Found a typo? Something is wrong in this documentation? Just fork and edit it!