d2e466e4cdd293e5390b35ddd6d4a311bece91dc
[yaffs-website] / vendor / drupal / console / templates / module / src / Plugin / Mail / mail.php.twig
1 {% extends "base/class.php.twig" %}
2
3 {% block file_path %}
4 \Drupal\{{module}}\Plugin\Mail\{{class_name}}.
5 {% endblock %}
6
7 {% block namespace_class %}
8 namespace Drupal\{{module}}\Plugin\Mail;
9 {% endblock %}
10
11 {% block use_class %}
12 use Drupal\Core\Mail\Plugin\Mail\PhpMail;
13 {% if services is not empty %}
14 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
15 use Symfony\Component\DependencyInjection\ContainerInterface;
16 {% endif %}
17 {% endblock %}
18
19 {% block class_declaration %}
20 /**
21  * Provides a '{{class_name}}' mail plugin.
22  *
23  * @Mail(
24  *  id = "{{plugin_id}}",
25  *  label = @Translation("{{label}}")
26  * )
27  */
28 class {{class_name}} extends PhpMail {% if services is not empty %}implements ContainerFactoryPluginInterface {% endif %}
29 {% endblock %}
30
31 {% block class_construct %}
32 {% if services is not empty %}
33   /**
34    * Construct.
35    *
36    * @param array $configuration
37    *   A configuration array containing information about the plugin instance.
38    * @param string $plugin_id
39    *   The plugin_id for the plugin instance.
40    * @param string $plugin_definition
41    *   The plugin implementation definition.
42    */
43   public function __construct(
44         array $configuration,
45         $plugin_id,
46         $plugin_definition,
47         {{ servicesAsParameters(services)|join(', \n\t') }}
48   ) {
49     parent::__construct($configuration, $plugin_id, $plugin_definition);
50 {{ serviceClassInitialization(services) }}
51   }
52
53 {% endif %}
54 {% endblock %}
55
56 {% block class_create %}
57 {% if services is not empty %}
58   /**
59    * {@inheritdoc}
60    */
61   public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
62     return new static(
63       $configuration,
64       $plugin_id,
65       $plugin_definition,
66 {{ serviceClassInjection(services) }}
67     );
68   }
69 {% endif %}
70 {% endblock %}
71
72 {% block class_methods %}
73
74   /**
75    * {@inheritdoc}
76    */
77   public function format(array $message) {
78   }
79
80   /**
81    * {@inheritdoc}
82    */
83   public function mail(array $message) {
84   }
85 {% endblock %}