Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
novicell/dds_content / src / DDSContentUninstallValidator.php
Size: Mime:
<?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;
  }


}