3 namespace Drupal\media_entity_test_type\Plugin\MediaEntity\Type;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\media_entity\Plugin\MediaEntity\Type\Generic;
9 * Provides generic media type.
13 * label = @Translation("Test type"),
14 * description = @Translation("Test media type.")
17 class TestType extends Generic {
22 public function providedFields() {
24 'field_1' => $this->t('Field 1'),
25 'field_2' => $this->t('Field 2'),
32 public function defaultConfiguration() {
34 'test_config_value' => 'This is default value.',
41 public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
42 $form['test_config_value'] = [
43 '#type' => 'textfield',
44 '#title' => $this->t('Test config value'),
45 '#default_value' => empty($this->configuration['test_config_value']) ? NULL : $this->configuration['test_config_value'],