diff --git a/core/includes/entity.inc b/core/includes/entity.inc index 4d22c3e..b364cc5 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc @@ -155,7 +155,7 @@ function entity_revision_delete($entity_type, $revision_id) { * @see \Drupal\Core\Entity\Sql\SqlContentEntityStorage * @see \Drupal\Core\Entity\Query\QueryInterface * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 9.0.0. Use + * @deprecated in Drupal 8.0.x, will be removed before Drupal 9.0.0. Use * the ::loadMultiple($ids) method if the entity type is known or * \Drupal::entityManager()->getStorage($entity_type)->loadMultiple($ids) if the * entity type is variable. @@ -247,10 +247,10 @@ function entity_delete_multiple($entity_type, array $ids) { * @return \Drupal\Core\Entity\EntityInterface * A new entity object. * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 9.0.0. Use - * the ::create($values) method if the entity type is known or - * \Drupal::entityManager()->getStorage($entity_type)->create($values) if the - * entity type is variable. + * @deprecated in Drupal 8.0.x, will be removed before Drupal 9.0.0. + * Use the ::create($values) method if the entity type is known + * or \Drupal::entityManager()->getStorage($entity_type)->create($values) if the + * entity type is variable. */ function entity_create($entity_type, array $values = array()) { return \Drupal::entityManager() @@ -276,7 +276,7 @@ function entity_create($entity_type, array $values = array()) { * * @see \Drupal\Core\Entity\EntityInterface::label() * - * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use + * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. * Use $entity->label($langcode); */ function entity_page_label(EntityInterface $entity, $langcode = NULL) { @@ -300,8 +300,8 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) { * @return array * A render array for the entity. * - * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use - * Entity Manager view method for it after building the entity view using + * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. + * Use Entity Manager view method for it after building the entity view using * getViewBuilder method. * $render_controller = \Drupal::entityManager()->getViewBuilder($entity->getEntityTypeId()); * return $render_controller->view($entity, $view_mode, $langcode); @@ -332,8 +332,8 @@ function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $res * A render array for the entities, indexed by the same keys as the * entities array passed in $entities. * - * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use - * Entity Manager viewMultiple method for it after building the entity view + * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. + * Use Entity Manager viewMultiple method for it after building the entity view * using getViewBuilder method. * $render_controller = \Drupal::entityManager()->getViewBuilder($entity->getEntityTypeId()); * return $render_controller->viewMultiple($entities, $view_mode, $langcode); @@ -385,8 +385,17 @@ function entity_view_multiple(array $entities, $view_mode, $langcode = NULL, $re * @return \Drupal\Core\Entity\Display\EntityViewDisplayInterface * The entity view display associated to the view mode. * - * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use - * EntityManager load function to load entity specific view display. + * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. + * If display is available in configuration then use : + * \Drupal::entityManager()->getStorage('entity_view_display')->load($entity_type . '.' . $bundle . '.' . $view_mode); + * else use: + * $values = ('entity_view_display', array( + * 'targetEntityType' => $entity_type, + * 'bundle' => $bundle, + * 'mode' => $view_mode, + * 'status' => TRUE, + * )); + * \Drupal::entityManager()->getStorage('entity_view_display')->create($values); */ function entity_get_display($entity_type, $bundle, $view_mode) { // Try loading the display from configuration. @@ -445,7 +454,16 @@ function entity_get_display($entity_type, $bundle, $view_mode) { * The entity form display associated to the given form mode. * * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0. Use - * EntityManager load function to load its specific form display. + * If display is available in configuration then use : + * \Drupal::entityManager()->getStorage('entity_form_display')->load($entity_type . '.' . $bundle . '.' . $form_mode); + * else use: + * $values = ('entity_form_display', array( + * 'targetEntityType' => $entity_type, + * 'bundle' => $bundle, + * 'mode' => $form_mode, + * 'status' => TRUE, + * )); + * \Drupal::entityManager()->getStorage('entity_form_display')->create($values); */ function entity_get_form_display($entity_type, $bundle, $form_mode) { // Try loading the entity from configuration.