comparison core/modules/field_ui/src/Controller/EntityDisplayModeController.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
16 * @return array 16 * @return array
17 * A list of entity types to add a view mode for. 17 * A list of entity types to add a view mode for.
18 */ 18 */
19 public function viewModeTypeSelection() { 19 public function viewModeTypeSelection() {
20 $entity_types = []; 20 $entity_types = [];
21 foreach ($this->entityManager()->getDefinitions() as $entity_type_id => $entity_type) { 21 foreach ($this->entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) {
22 if ($entity_type->get('field_ui_base_route') && $entity_type->hasViewBuilderClass()) { 22 if ($entity_type->get('field_ui_base_route') && $entity_type->hasViewBuilderClass()) {
23 $entity_types[$entity_type_id] = [ 23 $entity_types[$entity_type_id] = [
24 'title' => $entity_type->getLabel(), 24 'title' => $entity_type->getLabel(),
25 'url' => Url::fromRoute('entity.entity_view_mode.add_form', ['entity_type_id' => $entity_type_id]), 25 'url' => Url::fromRoute('entity.entity_view_mode.add_form', ['entity_type_id' => $entity_type_id]),
26 'localized_options' => [], 26 'localized_options' => [],
39 * @return array 39 * @return array
40 * A list of entity types to add a form mode for. 40 * A list of entity types to add a form mode for.
41 */ 41 */
42 public function formModeTypeSelection() { 42 public function formModeTypeSelection() {
43 $entity_types = []; 43 $entity_types = [];
44 foreach ($this->entityManager()->getDefinitions() as $entity_type_id => $entity_type) { 44 foreach ($this->entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) {
45 if ($entity_type->get('field_ui_base_route') && $entity_type->hasFormClasses()) { 45 if ($entity_type->get('field_ui_base_route') && $entity_type->hasFormClasses()) {
46 $entity_types[$entity_type_id] = [ 46 $entity_types[$entity_type_id] = [
47 'title' => $entity_type->getLabel(), 47 'title' => $entity_type->getLabel(),
48 'url' => Url::fromRoute('entity.entity_form_mode.add_form', ['entity_type_id' => $entity_type_id]), 48 'url' => Url::fromRoute('entity.entity_form_mode.add_form', ['entity_type_id' => $entity_type_id]),
49 'localized_options' => [], 49 'localized_options' => [],