generate:service

Génère un service

Utilisation:

drupal generate:service  [options]
gs

Options disponibles

OptionDétails

--module

Le nom du module.

--name

Le nom du service

--class

Nom de la classe

--interface

Interface

--interface-name

Interface name

--logger-channel

Logger channel

--services

Charger des services depuis le conteneur.

--path-service

Path

Exemples

Generate a services without interface specifying the module name, the service name, the class and its path

drupal generate:service  \
  --module="modulename"  \
  --name="modulename.default"  \
  --class="DefaultService"  \
  --path-service="/modules/custom/modulename/src/"

Generate a services with interface specifying the module name, the service name, the class, the interface name and its path

drupal generate:service  \
  --module="modulename"  \
  --name="modulename.default"  \
  --class="DefaultService"  \
  --interface  \
  --interface-name="InterfaceName"  \
  --path-service="/modules/custom/modulename/src/"