interface MediaTypeInterface in Media entity 8
Defines the interface for media types.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurablePluginInterface; interface \Drupal\Core\Plugin\PluginFormInterface
- interface \Drupal\media_entity\MediaTypeInterface
Expanded class hierarchy of MediaTypeInterface
All classes that implement MediaTypeInterface
File
- src/
MediaTypeInterface.php, line 12
Namespace
Drupal\media_entityView source
interface MediaTypeInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface {
/**
* Returns the display label.
*
* @return string
* The display label.
*/
public function label();
/**
* Gets list of fields provided by this plugin.
*
* @return array
* Associative array with field names as keys and descriptions as values.
*/
public function providedFields();
/**
* Gets a media-related field/value.
*
* @param MediaInterface $media
* Media object.
* @param string $name
* Name of field to fetch.
*
* @return mixed
* Field value or FALSE if data unavailable.
*/
public function getField(MediaInterface $media, $name);
/**
* Attaches type-specific constraints to media.
*
* @param MediaInterface $media
* Media entity.
*/
public function attachConstraints(MediaInterface $media);
/**
* Gets thumbnail image.
*
* Media type plugin is responsible for returning URI of the generic thumbnail
* if no other is available. This functions should always return a valid URI.
*
* @param MediaInterface $media
* Media.
*
* @return string
* URI of the thumbnail.
*/
public function thumbnail(MediaInterface $media);
/**
* Gets the default thumbnail image.
*
* @return string
* Uri of the default thumbnail image.
*/
public function getDefaultThumbnail();
/**
* Provide a default name for the media.
*
* Plugins defining media bundles are suggested to override this method and
* provide a default name, to be used when there is no user-defined label
* available.
*
* @param \Drupal\media_entity\MediaInterface $media
* The media object.
*
* @return string
* The string that should be used as default media name.
*/
public function getDefaultName(MediaInterface $media);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurablePluginInterface:: |
public | function | Gets default configuration for this plugin. | 1 |
ConfigurablePluginInterface:: |
public | function | Gets this plugin's configuration. | 1 |
ConfigurablePluginInterface:: |
public | function | Sets the configuration for this plugin instance. | 1 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
MediaTypeInterface:: |
public | function | Attaches type-specific constraints to media. | 1 |
MediaTypeInterface:: |
public | function | Provide a default name for the media. | 1 |
MediaTypeInterface:: |
public | function | Gets the default thumbnail image. | 1 |
MediaTypeInterface:: |
public | function | Gets a media-related field/value. | 1 |
MediaTypeInterface:: |
public | function | Returns the display label. | 1 |
MediaTypeInterface:: |
public | function | Gets list of fields provided by this plugin. | 1 |
MediaTypeInterface:: |
public | function | Gets thumbnail image. | 1 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |