You are here

public static function LibraryItemInterface::createFromParagraph in Paragraphs 8

Creates a library entity from a paragraph entity.

Parameters

\Drupal\paragraphs\ParagraphInterface $paragraph: The paragraph entity.

Return value

\Drupal\paragraphs_library\LibraryItemInterface The library item entity.

Throws

\Exception If a conversion is attempted for bundles that don't support it.

1 method overrides LibraryItemInterface::createFromParagraph()
LibraryItem::createFromParagraph in modules/paragraphs_library/src/Entity/LibraryItem.php
Creates a library entity from a paragraph entity.

File

modules/paragraphs_library/src/LibraryItemInterface.php, line 29

Class

LibraryItemInterface
Provides an interface defining a paragraphs entity.

Namespace

Drupal\paragraphs_library

Code

public static function createFromParagraph(ParagraphInterface $paragraph);