Updating Media dependent modules to versions compatible with core Media.
[yaffs-website] / web / modules / contrib / media_entity / src / EmbedCodeValueTrait.php
diff --git a/web/modules/contrib/media_entity/src/EmbedCodeValueTrait.php b/web/modules/contrib/media_entity/src/EmbedCodeValueTrait.php
deleted file mode 100644 (file)
index b9acaca..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-namespace Drupal\media_entity;
-
-use Drupal\Core\Field\FieldItemInterface;
-
-/**
- * A trait to assist with handling external embed codes.
- */
-trait EmbedCodeValueTrait {
-
-  /**
-   * Extracts the raw embed code from input which may or may not be wrapped.
-   *
-   * @param mixed $value
-   *   The input value. Can be a normal string or a value wrapped by the
-   *   Typed Data API.
-   *
-   * @return string|null
-   *   The raw embed code.
-   */
-  protected function getEmbedCode($value) {
-    if (is_string($value)) {
-      return $value;
-    }
-    elseif ($value instanceof FieldItemInterface) {
-      $class = get_class($value);
-      $property = $class::mainPropertyName();
-      if ($property) {
-        return $value->$property;
-      }
-    }
-  }
-
-}