function _drush_onlyone_available in Allow a content type only once (Only One) 8
Same name and namespace in other branches
- 7 onlyone.drush.inc \_drush_onlyone_available()
List the content types that can be configured in 'Only One content' mode.
File
- ./
onlyone.drush.inc, line 137 - Drush commands related to the Only One module.
Code
function _drush_onlyone_available() {
$available_content_types = Drupal::service('onlyone')
->setFormatter(new OnlyOnePrintDrush())
->getAvailableContentTypesForPrint();
if (count($available_content_types)) {
drush_print(dt("Content types that can be configured in 'Only One content' mode:"));
drush_print(' ' . implode("\n ", $available_content_types));
}
else {
drush_print(dt("There is no content type that can be configured in 'Only One content' mode."));
}
}