# ESM (Entity, Service, Manager) Generation Tool

Our in-house ESM tool streamlines the development process by automating the creation of entities, services, and managers.

## Entity, Service, and Manager Generation

To create a new entity, use the following command:
```bash
$ make esm_generate
```

This command runs the `class_generators/generateESM.php` script, which guides you through the entity creation process by requesting:

- The entity's name and directory.
- Property names, their types, and whether they are nullable.

Following this, the script generates:

- A new entity complete with phpdoc, properties, a constructor, getters, setters, and the hydrate() and populate() functions.
- A service and a manager with basic functions: add(), update(), find(), findAll(), findByIds(), delete(), and deleteByIds(), all accompanied by phpdoc, a constructor, and the getEntity() function for the manager.
- An empty migration file.

**WARNING**: While you can create an array property in the entity, the database conversion of this array in the manager is not supported. You'll need to handle this conversion manually after the files are created.

## Migration File Content Generation

To generate the content of a migration file, use the following command:
```bash
$ make migration_licence_content_generate
```

This command runs the `class_generators/generateMigration.php` script, which guides you through the migration creation process by requesting:

- The migration file's name.
- The directory and class of the entity you wish to migrate.

**WARNING**: Although you can create an array property in the entity, using this array in the migration file is not supported. You'll need to handle this manually after the files are created.
