You are here

function _drush_onlyone_notavailable in Allow a content type only once (Only One) 8

Same name and namespace in other branches
  1. 7 onlyone.drush.inc \_drush_onlyone_notavailable()

List the content types that can't be configured in 'Only One content' mode.

File

./onlyone.drush.inc, line 152
Drush commands related to the Only One module.

Code

function _drush_onlyone_notavailable() {
  $not_available_content_types = Drupal::service('onlyone')
    ->setFormatter(new OnlyOnePrintDrush())
    ->getNotAvailableContentTypesForPrint();
  if (count($not_available_content_types)) {
    drush_print(dt("Content types that can't be configured in 'Only One content' mode:"));
    drush_print(' ' . implode("\n ", $not_available_content_types));
  }
  else {
    drush_print(dt("All content types can be configured in 'Only One content' mode."));
  }
}