EntitySchema helper you define the schema programmatically.
When creating new entity instances, you will need to use
em.create() method that will
create instance of internally created class.
Using this approach, metadata caching is automatically disabled as it is not needed.
You can optionally use custom class for entity instances.
Then you can use the entity class as usual:
Do not forget that base entities needs to be discovered just like normal entities.
The parameter of
EntitySchema requires to provide either
extends will be automatically inferred. You can optionally pass
these additional parameters:
Every property then needs to contain a type specification - one of
Here are some examples of various property types:
As a value for
typeyou can also use one of