Drupal 8  8.0.2
AdminPathConfigEntityConverter Class Reference
Inheritance diagram for AdminPathConfigEntityConverter:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, AdminContext $admin_context)
 
 convert ($value, $definition, $name, array $defaults)
 
 applies ($definition, $name, Route $route)
 
- Public Member Functions inherited from EntityConverter
 __construct (EntityManagerInterface $entity_manager)
 
 convert ($value, $definition, $name, array $defaults)
 
 applies ($definition, $name, Route $route)
 

Protected Attributes

 $configFactory
 
 $adminContext
 
- Protected Attributes inherited from EntityConverter
 $entityManager
 

Additional Inherited Members

- Protected Member Functions inherited from EntityConverter
 getEntityTypeFromDefaults ($definition, $name, array $defaults)
 

Detailed Description

Makes sure the unmodified ConfigEntity is loaded on admin pages.

Converts entity route arguments to unmodified entities as opposed to converting to entities with overrides, such as the negotiated language.

This converter applies only if the path is an admin path, the entity is a config entity, and the "with_config_overrides" element is not set to TRUE on the parameter definition.

Due to this converter having a higher weight than the default EntityConverter, every time this applies, it takes over the conversion duty from EntityConverter. As we only allow a single converter per route argument, EntityConverter is ignored when this converter applies.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
ConfigFactoryInterface  $config_factory,
AdminContext  $admin_context 
)

Constructs a new EntityConverter.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe config factory.
\Drupal\Core\Routing\AdminContext$admin_contextThe route admin context service.

References Drupal\configFactory().

Here is the call graph for this function:

Member Function Documentation

applies (   $definition,
  $name,
Route  $route 
)

{Determines if the converter applies to a specific route and variable.

Parameters
mixed$definitionThe parameter definition provided in the route options.
string$nameThe name of the parameter.
\Symfony\Component\Routing\Route$routeThe route to consider attaching to.
Returns
bool TRUE if the converter applies to the passed route and parameter, FALSE otherwise.
}

Implements ParamConverterInterface.

References Drupal\entityManager().

Here is the call graph for this function:

convert (   $value,
  $definition,
  $name,
array  $defaults 
)

{Converts path variables to their corresponding objects.

Parameters
mixed$valueThe raw value.
mixed$definitionThe parameter definition provided in the route options.
string$nameThe name of the parameter.
array$defaultsThe route defaults array.
Returns
mixed|null The converted parameter value.
}

Implements ParamConverterInterface.

References Drupal\entityManager(), and EntityConverter\getEntityTypeFromDefaults().

Here is the call graph for this function:


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