Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / entity / src / EntityViewBuilder.php
index e47181f2cbea314743122c689d005f11e422d1cc..1efe0ebe6a9ce85351c59f87d7eb09c031390eb9 100644 (file)
@@ -2,36 +2,16 @@
 
 namespace Drupal\entity;
 
-use Drupal\Core\Entity\ContentEntityInterface;
-use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
-use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityViewBuilder as CoreEntityViewBuilder;
 
+@trigger_error('\Drupal\entity\EntityViewBuilder has been deprecated in favor of \Drupal\Core\Entity\EntityViewBuilder. Use that instead.');
+
 /**
- * Provides a entity view builder with contextual links support
+ * Provides a entity view builder with contextual links support.
+ *
+ * @deprecated in favor of \Drupal\Core\Entity\EntityViewBuilder. Use that
+ *   instead.
  */
 class EntityViewBuilder extends CoreEntityViewBuilder {
 
-  /**
-   * {@inheritdoc}
-   */
-  protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
-    $entity_type_id = $entity->getEntityTypeId();
-    if (($entity instanceof ContentEntityInterface && $entity->isDefaultRevision()) || !$entity->getEntityType()->isRevisionable()) {
-      $build['#contextual_links'][$entity_type_id] = [
-        'route_parameters' => [
-          $entity_type_id => $entity->id()
-        ],
-      ];
-    }
-    else {
-      $build['#contextual_links'][$entity_type_id . '_revision'] = [
-        'route_parameters' => [
-          $entity_type_id => $entity->id(),
-          $entity_type_id . '_revision' => $entity->getRevisionId(),
-        ],
-      ];
-    }
-  }
-
 }