public function LingotekFieldDeletedConfigSubscriber::onConfigDelete in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.0.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.1.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.2.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.3.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.4.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.5.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.6.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.7.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
- 3.8.x src/EventSubscriber/LingotekFieldDeletedConfigSubscriber.php \Drupal\lingotek\EventSubscriber\LingotekFieldDeletedConfigSubscriber::onConfigDelete()
Updates the Lingotek configuration when a field is deleted.
Parameters
\Drupal\Core\Config\ConfigCrudEvent $event: The configuration event.
File
- src/
EventSubscriber/ LingotekFieldDeletedConfigSubscriber.php, line 49
Class
- LingotekFieldDeletedConfigSubscriber
- Updates Lingotek config if a field is deleted.
Namespace
Drupal\lingotek\EventSubscriberCode
public function onConfigDelete(ConfigCrudEvent $event) {
if (!InstallerKernel::installationAttempted()) {
$config = $event
->getConfig();
if ($config instanceof FieldConfigInterface) {
$field_name = $config
->getName();
$entity_type_id = $config
->getTargetEntityTypeId();
$bundle = $config
->getTargetBundle();
$this->lingotekConfiguration
->setFieldLingotekEnabled($entity_type_id, $bundle, $field_name, FALSE);
}
}
}