You are here

protected function MenuItemExtrasUninstallValidator::hasExtraData in Menu Item Extras 8.2

Determines if there is any extra data for menu or not.

Return value

bool TRUE if there are extra data for menus, FALSE otherwise.

1 call to MenuItemExtrasUninstallValidator::hasExtraData()
MenuItemExtrasUninstallValidator::validate in src/MenuItemExtrasUninstallValidator.php
Determines the reasons a module can not be uninstalled.

File

src/MenuItemExtrasUninstallValidator.php, line 57

Class

MenuItemExtrasUninstallValidator
Prevents uninstall menu item extras module if there are extra data.

Namespace

Drupal\menu_item_extras

Code

protected function hasExtraData() {
  $results = $this->connection
    ->select('menu_link_content_data', 'mlcd')
    ->fields('mlcd', [
    'view_mode',
  ])
    ->isNotNull('view_mode')
    ->execute()
    ->fetchAll();
  return !empty($results);
}