public function ParagraphsConversionBase::supports

Check if the current plugin supports conversion for a paragraph.

This method checks whether a plugin supports a paragraph type to be converted.

Parameters

\Drupal\paragraphs\ParagraphInterface $paragraph: The paragraph that will be checked is supported by the plugin.

array $parent_allowed_types: (optional) The allowed paragraph types on the parent field.

Overrides ParagraphsConversionInterface::supports

File

paragraphs/src/ParagraphsConversionBase.php, line 107

Class

ParagraphsConversionBase
Provides a base class for paragraphs conversions.

Namespace

Drupal\paragraphs

Code

public function supports(ParagraphInterface $paragraph, array $parent_allowed_types = NULL) {
  return $paragraph
    ->getType() == $this
    ->getPluginDefinition()['source_type'];
}