Factory
Each entity should have a factory that helps to generate a new entity.
A factory must implements App\Core\Factory\FactoryInterface.
Generation
A factory is basically a service which contain at lease a method named create.
The generation is performed in CLI. These information are required:
- The name of the futur factory (eg:
MyEntityFactory) - The namespace of the entity (eg:
MyEntity)
Simply run php bin/console make:factory.