private function OnlyOne::getTemporaryContentTypesTableName in Allow a content type only once (Only One) 8
Returns the temporary table name created with all the content types names.
Return value
string The temporary table name.
2 calls to OnlyOne::getTemporaryContentTypesTableName()
- OnlyOne::getAvailableContentTypes in src/
OnlyOne.php - Return the available content types.
- OnlyOne::getAvailableContentTypesSummarized in src/
OnlyOne.php - Return the available content types with their number of nodes.
File
- src/
OnlyOne.php, line 90
Class
- OnlyOne
- Class OnlyOne.
Namespace
Drupal\onlyoneCode
private function getTemporaryContentTypesTableName() {
// Looking for all the content types, as the content types are only
// accesibles through the entity_type.manager service we can't use a
// LEFT JOIN in only one query as is posible in Drupal 7
// (See Drupal 7 module version).
// @see https://drupal.stackexchange.com/q/233214/28275
// @see https://drupal.stackexchange.com/q/235640/28275
// Looking for the content type names from the config table.
$query_content_types = "SELECT DISTINCT SUBSTR(name, 11) AS type\n FROM {config}\n WHERE name LIKE 'node.type.%'";
// Creating a temporary table and returning the name.
return $this->connection
->queryTemporary($query_content_types);
}