Drupal 8  8.0.2
FieldModuleUninstallValidator Class Reference
Inheritance diagram for FieldModuleUninstallValidator:

Public Member Functions

 __construct (\Symfony\Component\DependencyInjection\ContainerInterface $container, $drupal_proxy_original_service_id)
 
 validate ($module_name)
 
 setStringTranslation (\Drupal\Core\StringTranslation\TranslationInterface $translation)
 

Protected Member Functions

 lazyLoadItself ()
 

Protected Attributes

 $drupalProxyOriginalServiceId
 
 $service
 
 $container
 

Detailed Description

Provides a proxy class for .

See Also

Constructor & Destructor Documentation

__construct ( \Symfony\Component\DependencyInjection\ContainerInterface  $container,
  $drupal_proxy_original_service_id 
)

Constructs a ProxyClass Drupal proxy object.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container.
string$drupal_proxy_original_service_idThe service ID of the original service.

Member Function Documentation

lazyLoadItself ( )
protected

Lazy loads the real service from the container.

Returns
object Returns the constructed real service.

References Drupal\service().

Referenced by FieldModuleUninstallValidator\setStringTranslation(), and FieldModuleUninstallValidator\validate().

Here is the call graph for this function:

Here is the caller graph for this function:

setStringTranslation ( \Drupal\Core\StringTranslation\TranslationInterface  $translation)

{}

References FieldModuleUninstallValidator\lazyLoadItself().

Here is the call graph for this function:

validate (   $module_name)

{Determines the reasons a module can not be uninstalled.Example implementation:

public function validate($module) {
$entity_types = $this->entityManager->getDefinitions();
$reasons = array();
foreach ($entity_types as $entity_type) {
if ($module == $entity_type->getProvider() && $entity_type instanceof ContentEntityTypeInterface && $this->entityManager->getStorage($entity_type->id())->hasData()) {
$reasons[] = $this->t('There is content for the entity type: @entity_type', array('@entity_type' => $entity_type->getLabel()));
}
}
return $reasons;
}
Parameters
string$moduleA module name.
Returns
string[] An array of reasons the module can not be uninstalled, empty if it can. Each reason should not end with any punctuation since multiple reasons can be displayed together.
See Also
template_preprocess_system_modules_uninstall()
}

Implements ModuleUninstallValidatorInterface.

References FieldModuleUninstallValidator\lazyLoadItself().

Here is the call graph for this function:


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