public function Video::appliesTo in Lightning Media 8.2
Same name and namespace in other branches
- 8.4 modules/lightning_media_video/src/Plugin/media/Source/Video.php \Drupal\lightning_media_video\Plugin\media\Source\Video::appliesTo()
- 8 modules/lightning_media_video/src/Plugin/media/Source/Video.php \Drupal\lightning_media_video\Plugin\media\Source\Video::appliesTo()
- 8.3 modules/lightning_media_video/src/Plugin/media/Source/Video.php \Drupal\lightning_media_video\Plugin\media\Source\Video::appliesTo()
Checks if this media type can handle a given input value.
Parameters
mixed $value: The input value.
\Drupal\media\MediaTypeInterface $bundle: The media bundle that is using this plugin.
Return value
bool TRUE if the input can be handled by this plugin, FALSE otherwise.
Overrides InputMatchInterface::appliesTo
File
- modules/
lightning_media_video/ src/ Plugin/ media/ Source/ Video.php, line 17
Class
- Video
- Input-matching version of the VideoEmbedField media type.
Namespace
Drupal\lightning_media_video\Plugin\media\SourceCode
public function appliesTo($value, MediaTypeInterface $media_type) {
$value = $this
->toString($value);
return isset($value) ? (bool) $this->providerManager
->loadProviderFromInput($value) : FALSE;
}