/** * Returns entity (form) displays for the current entity display type. * * @return \Drupal\Core\Entity\Display\EntityDisplayInterface[] * An array holding entity displays or entity form displays. */ protected function getDisplays() { $load_ids = array(); $display_entity_type = $this->entity->getEntityTypeId(); $entity_type = $this->entityManager->getDefinition($display_entity_type); $config_prefix = $entity_type->getConfigPrefix(); $ids = $this->configFactory()->listAll($config_prefix . '.' . $this->entity->getTargetEntityTypeId() . '.' . $this->entity->getTargetBundle() . '.'); foreach ($ids as $id) { $config_id = str_replace($config_prefix . '.', '', $id); list(, , $display_mode) = explode('.', $config_id); if ($display_mode != 'default') { $load_ids[] = $config_id; } } return $this->entityManager->getStorage($display_entity_type)->loadMultiple($load_ids); }