protected EntityRevisionConverter::isEditFormPage(Route $route)
Determines if a given route is the edit-form for an entity.
Parameters
\Symfony\Component\Routing\Route $route: The route definition.
Return value
bool Returns TRUE if the route is the edit form of an entity, FALSE otherwise.
File
- core/modules/content_moderation/src/ParamConverter/EntityRevisionConverter.php, line 72
Class
- EntityRevisionConverter
- Defines a class for making sure the edit-route loads the current draft.
Namespace
Drupal\content_moderation\ParamConverter
Code
1 2 3 4 5 6 7 8 9 10 11 12 | protected function isEditFormPage(Route $route ) { if ( $default = $route ->getDefault( '_entity_form' )) { // If no operation is provided, use 'default'. $default .= '.default' ; list( $entity_type_id , $operation ) = explode ( '.' , $default ); if (! $this ->entityManager->hasDefinition( $entity_type_id )) { return FALSE; } $entity_type = $this ->entityManager->getDefinition( $entity_type_id ); return $operation == 'edit' && $entity_type && $entity_type ->isRevisionable(); } } |
Please login to continue.