Generic.php in Media entity 8
File
src/Plugin/MediaEntity/Type/Generic.php
View source
<?php
namespace Drupal\media_entity\Plugin\MediaEntity\Type;
use Drupal\Core\Form\FormStateInterface;
use Drupal\media_entity\MediaInterface;
use Drupal\media_entity\MediaTypeBase;
class Generic extends MediaTypeBase {
public function providedFields() {
return [];
}
public function getField(MediaInterface $media, $name) {
return FALSE;
}
public function thumbnail(MediaInterface $media) {
return $this->config
->get('icon_base') . '/generic.png';
}
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['text'] = [
'#type' => 'markup',
'#markup' => $this
->t("This type provider doesn't need configuration."),
];
return $form;
}
}