Skip to content
Snippets Groups Projects
Commit f154a0e0 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2547933 by googletorp, jhodgdon: Code example for non deprecated use of...

Issue #2547933 by googletorp, jhodgdon: Code example for non deprecated use of entity_get_display is wrong
parent 25f26ed1
No related branches found
No related tags found
No related merge requests found
......@@ -443,20 +443,20 @@ function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $re
*
* @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
* If the display is available in configuration use:
* @code
* @code
* \Drupal::entityManager()->getStorage('entity_view_display')->load($entity_type . '.' . $bundle . '.' . $view_mode);
* @endcode
* @endcode
* When the display is not available in configuration, you can create a new
* EntityViewDisplay object using:
* @code
* $values = ('entity_view_display', array(
* 'targetEntityType' => $entity_type,
* 'bundle' => $bundle,
* 'mode' => $view_mode,
* 'status' => TRUE,
* ));
* \Drupal::entityManager()->getStorage('entity_view_display')->create($values);
* @endcode
* @code
* $values = array(
* 'targetEntityType' => $entity_type,
* 'bundle' => $bundle,
* 'mode' => $view_mode,
* 'status' => TRUE,
* ));
* \Drupal::entityManager()->getStorage('entity_view_display')->create($values);
* @endcode
*
* @see \Drupal\Core\Entity\EntityStorageInterface::create()
* @see \Drupal\Core\Entity\EntityStorageInterface::load()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment