You are here

public static function SuggestionStorage::getContentTypes in Autocomplete Search Suggestions 8.2

Same name and namespace in other branches
  1. 8 src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::getContentTypes()
  2. 3.0.x src/SuggestionStorage.php \Drupal\suggestion\SuggestionStorage::getContentTypes()

Fetch an array of content types.

Return value

array An array of content types.

1 call to SuggestionStorage::getContentTypes()
SuggestionAdminForm::getContentTypes in src/Form/SuggestionAdminForm.php
Build a content type to label hash.

File

src/SuggestionStorage.php, line 114

Class

SuggestionStorage
Database CRUD.

Namespace

Drupal\suggestion

Code

public static function getContentTypes() {
  return \Drupal::database()
    ->query("SELECT DISTINCT(type), type FROM {node} ORDER BY type ASC")
    ->fetchAllKeyed();
}