class ParagraphsTestTextToTextImage

Provides a Paragraphs conversion plugin.

Plugin annotation


@ParagraphsConversion(
  id = "paragraphs_test_text_to_text_image",
  label = @Translation("Convert to Text Image (No form)"),
  source_type = "text",
  target_type = {"text_image"}
)

Hierarchy

Expanded class hierarchy of ParagraphsTestTextToTextImage

File

paragraphs/tests/modules/paragraphs_test/src/Plugin/paragraphs/Conversion/ParagraphsTestTextToTextImage.php, line 18

Namespace

Drupal\paragraphs_test\Plugin\paragraphs\Conversion
View source
class ParagraphsTestTextToTextImage extends ParagraphsConversionBase {

  /**
   * {@inheritdoc}
   */
  public function submitConversion(array $settings, ParagraphInterface $original_paragraph, array $converted_paragraphs = NULL) {
    $text = $original_paragraph
      ->get('field_text_demo')->value;
    return [
      [
        'type' => 'text_image',
        'field_text_demo' => [
          'value' => $text,
        ],
      ],
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ParagraphsConversionBase::buildConfigurationForm public function
ParagraphsConversionBase::buildConversionForm public function Builds a conversion form to add extra settings to the conversion. Overrides ParagraphsConversionInterface::buildConversionForm 1
ParagraphsConversionBase::calculateDependencies public function
ParagraphsConversionBase::convert public function Submit the values taken from the form to store the values. Overrides ParagraphsConversionInterface::convert 2
ParagraphsConversionBase::create public static function
ParagraphsConversionBase::defaultConfiguration public function
ParagraphsConversionBase::getConfiguration public function
ParagraphsConversionBase::setConfiguration public function
ParagraphsConversionBase::submitConfigurationForm public function
ParagraphsConversionBase::supports public function Check if the current plugin supports conversion for a paragraph. Overrides ParagraphsConversionInterface::supports
ParagraphsConversionBase::validateConfigurationForm public function
ParagraphsConversionBase::validateConversionForm public function Validates the conversion fields form. Overrides ParagraphsConversionInterface::validateConversionForm
ParagraphsConversionBase::__construct public function Constructs a ParagraphsBehaviorBase object.
ParagraphsTestTextToTextImage::submitConversion public function