Drupal 8  8.0.2
EntityDisplayRepository Class Reference
Inheritance diagram for EntityDisplayRepository:

Public Member Functions

 __construct (EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager)
 
 getAllViewModes ()
 
 getViewModes ($entity_type_id)
 
 getAllFormModes ()
 
 getFormModes ($entity_type_id)
 
 getViewModeOptions ($entity_type)
 
 getFormModeOptions ($entity_type_id)
 
 getViewModeOptionsByBundle ($entity_type_id, $bundle)
 
 getFormModeOptionsByBundle ($entity_type_id, $bundle)
 
 clearDisplayModeInfo ()
 

Protected Member Functions

 getAllDisplayModesByEntityType ($display_type)
 
 getDisplayModesByEntityType ($display_type, $entity_type_id)
 
 getDisplayModeOptions ($display_type, $entity_type_id)
 
 getDisplayModeOptionsByBundle ($display_type, $entity_type_id, $bundle)
 

Protected Attributes

 $displayModeInfo = []
 
 $languageManager
 
 $entityTypeManager
 
 $moduleHandler
 

Detailed Description

Provides a repository for entity display objects (view modes and form modes).

Constructor & Destructor Documentation

__construct ( EntityTypeManagerInterface  $entity_type_manager,
ModuleHandlerInterface  $module_handler,
CacheBackendInterface  $cache_backend,
LanguageManagerInterface  $language_manager 
)

Constructs a new EntityDisplayRepository.

Parameters
\Drupal\Core\Entity\EntityTypeManagerInterface$entity_type_managerThe entity type manager.
\Drupal\Core\Extension\ModuleHandlerInterface$module_handlerThe module handler.
\Drupal\Core\Cache\CacheBackendInterface$cache_backendThe cache backend.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager.

References Drupal\entityTypeManager(), Drupal\languageManager(), and Drupal\moduleHandler().

Here is the call graph for this function:

Member Function Documentation

clearDisplayModeInfo ( )

{Clears the gathered display mode info.

Returns
$this
}

Implements EntityDisplayRepositoryInterface.

getAllDisplayModesByEntityType (   $display_type)
protected

Gets the entity display mode info for all entity types.

Parameters
string$display_typeThe display type to be retrieved. It can be "view_mode" or "form_mode".
Returns
array The display mode info for all entity types.

References CacheBackendInterface\CACHE_PERMANENT, Drupal\entityTypeManager(), Drupal\languageManager(), Drupal\moduleHandler(), and LanguageInterface\TYPE_INTERFACE.

Referenced by EntityDisplayRepository\getAllFormModes(), EntityDisplayRepository\getAllViewModes(), and EntityDisplayRepository\getDisplayModesByEntityType().

Here is the call graph for this function:

Here is the caller graph for this function:

getAllFormModes ( )

{Gets the entity form mode info for all entity types.

Returns
array The form mode info for all entity types.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getAllDisplayModesByEntityType().

Here is the call graph for this function:

getAllViewModes ( )

{Gets the entity view mode info for all entity types.

Returns
array The view mode info for all entity types.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getAllDisplayModesByEntityType().

Here is the call graph for this function:

getDisplayModeOptions (   $display_type,
  $entity_type_id 
)
protected

Gets an array of display mode options.

Parameters
string$display_typeThe display type to be retrieved. It can be "view_mode" or "form_mode".
string$entity_type_idThe entity type whose display mode options should be returned.
Returns
array An array of display mode labels, keyed by the display mode ID.

References EntityDisplayRepository\getDisplayModesByEntityType(), and t().

Referenced by EntityDisplayRepository\getDisplayModeOptionsByBundle(), EntityDisplayRepository\getFormModeOptions(), and EntityDisplayRepository\getViewModeOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

getDisplayModeOptionsByBundle (   $display_type,
  $entity_type_id,
  $bundle 
)
protected

Returns an array of enabled display mode options by bundle.

Parameters
$display_typeThe display type to be retrieved. It can be "view_mode" or "form_mode".
string$entity_type_idThe entity type whose display mode options should be returned.
string$bundleThe name of the bundle.
Returns
array An array of display mode labels, keyed by the display mode ID.

References Drupal\entityTypeManager(), and EntityDisplayRepository\getDisplayModeOptions().

Referenced by EntityDisplayRepository\getFormModeOptionsByBundle(), and EntityDisplayRepository\getViewModeOptionsByBundle().

Here is the call graph for this function:

Here is the caller graph for this function:

getDisplayModesByEntityType (   $display_type,
  $entity_type_id 
)
protected

Gets the entity display mode info for a specific entity type.

Parameters
string$display_typeThe display type to be retrieved. It can be "view_mode" or "form_mode".
string$entity_type_idThe entity type whose display mode info should be returned.
Returns
array The display mode info for a specific entity type.

References EntityDisplayRepository\getAllDisplayModesByEntityType().

Referenced by EntityDisplayRepository\getDisplayModeOptions(), EntityDisplayRepository\getFormModes(), and EntityDisplayRepository\getViewModes().

Here is the call graph for this function:

Here is the caller graph for this function:

getFormModeOptions (   $entity_type_id)

{Gets an array of form mode options.

Parameters
string$entity_type_idThe entity type whose form mode options should be returned.
Returns
array An array of form mode labels, keyed by the display mode ID.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getDisplayModeOptions().

Here is the call graph for this function:

getFormModeOptionsByBundle (   $entity_type_id,
  $bundle 
)

{Returns an array of enabled form mode options by bundle.

Parameters
string$entity_type_idThe entity type whose form mode options should be returned.
string$bundleThe name of the bundle.
Returns
array An array of form mode labels, keyed by the display mode ID.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getDisplayModeOptionsByBundle().

Here is the call graph for this function:

getFormModes (   $entity_type_id)

{Gets the entity form mode info for a specific entity type.

Parameters
string$entity_type_idThe entity type whose form mode info should be returned.
Returns
array The form mode info for a specific entity type.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getDisplayModesByEntityType().

Here is the call graph for this function:

getViewModeOptions (   $entity_type)

{Gets an array of view mode options.

Parameters
string$entity_type_idThe entity type whose view mode options should be returned.
Returns
array An array of view mode labels, keyed by the display mode ID.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getDisplayModeOptions().

Here is the call graph for this function:

getViewModeOptionsByBundle (   $entity_type_id,
  $bundle 
)

{Returns an array of enabled view mode options by bundle.

Parameters
string$entity_type_idThe entity type whose view mode options should be returned.
string$bundleThe name of the bundle.
Returns
array An array of view mode labels, keyed by the display mode ID.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getDisplayModeOptionsByBundle().

Here is the call graph for this function:

getViewModes (   $entity_type_id)

{Gets the entity view mode info for a specific entity type.

Parameters
string$entity_type_idThe entity type whose view mode info should be returned.
Returns
array The view mode info for a specific entity type.
}

Implements EntityDisplayRepositoryInterface.

References EntityDisplayRepository\getDisplayModesByEntityType().

Here is the call graph for this function:


The documentation for this class was generated from the following file: