Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / src / Command / Drupal_8 / Plugin / Views / Field.php
diff --git a/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php b/vendor/chi-teck/drupal-code-generator/src/Command/Drupal_8/Plugin/Views/Field.php
new file mode 100644 (file)
index 0000000..e3f6a67
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+namespace DrupalCodeGenerator\Command\Drupal_8\Plugin\Views;
+
+use DrupalCodeGenerator\Command\BaseGenerator;
+use DrupalCodeGenerator\Utils;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Implements d8:plugin:views:field command.
+ */
+class Field extends BaseGenerator {
+
+  protected $name = 'd8:plugin:views:field';
+  protected $description = 'Generates views field plugin';
+  protected $alias = 'views-field';
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function interact(InputInterface $input, OutputInterface $output) {
+    $questions = Utils::defaultPluginQuestions();
+
+    $vars = &$this->collectVars($input, $output, $questions);
+    $vars['class'] = Utils::camelize($vars['plugin_label']);
+
+    $this->addFile()
+      ->path('src/Plugin/views/field/{class}.php')
+      ->template('d8/plugin/views/field.twig');
+  }
+
+}