Repository URL to install this package:
|
Version:
1.3.10 ▾
|
<?php
namespace Drupal\dds_content;
use Drupal\Core\Extension\ModuleUninstallValidatorInterface;
use Drupal\paragraphs\Entity\Paragraph;
/**
* Class DDSParagraphsUninstallValidator
* @package Drupal\dds_paragraphs
*/
class DDSContentUninstallValidator implements ModuleUninstallValidatorInterface {
/**
* {@inheritdoc}
*/
public function validate($module) {
$reasons = [];
switch ($module) {
case 'dds_content':
$ids = \Drupal::entityQuery('node')->condition('type', ['basic_page', 'special_page'], 'IN')->execute();
if($ids) {
$reasons[] = 'There is content for the node type "basic_page" or "special_page" in the database.';
}
break;
default:
break;
}
return $reasons;
}
}