X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrupal%2Fconsole%2Fsrc%2FGenerator%2FPluginFieldTypeGenerator.php;fp=vendor%2Fdrupal%2Fconsole%2Fsrc%2FGenerator%2FPluginFieldTypeGenerator.php;h=75f832a9da224acd895dbf8aeae414993295a791;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/drupal/console/src/Generator/PluginFieldTypeGenerator.php b/vendor/drupal/console/src/Generator/PluginFieldTypeGenerator.php new file mode 100644 index 000000000..75f832a9d --- /dev/null +++ b/vendor/drupal/console/src/Generator/PluginFieldTypeGenerator.php @@ -0,0 +1,55 @@ +extensionManager = $extensionManager; + } + + /** + * Generator Plugin Field Type. + * + * @param string $module Module name + * @param string $class_name Plugin Class name + * @param string $label Plugin label + * @param string $plugin_id Plugin id + * @param string $description Plugin description + * @param string $default_widget Default widget this field type used supports + * @param string $default_formatter Default formatter this field type used supports + */ + public function generate($module, $class_name, $label, $plugin_id, $description, $default_widget, $default_formatter) + { + $parameters = [ + 'module' => $module, + 'class_name' => $class_name, + 'label' => $label, + 'plugin_id' => $plugin_id, + 'description' => $description, + 'default_widget' => $default_widget, + 'default_formatter' => $default_formatter, + ]; + + $this->renderFile( + 'module/src/Plugin/Field/FieldType/fieldtype.php.twig', + $this->extensionManager->getPluginPath($module, 'Field/FieldType') . '/' . $class_name . '.php', + $parameters + ); + } +}