protected function OpenApiGeneratorBase::includeEntityTypeBundle in OpenAPI 8
Same name and namespace in other branches
- 8.2 src/Plugin/openapi/OpenApiGeneratorBase.php \Drupal\openapi\Plugin\openapi\OpenApiGeneratorBase::includeEntityTypeBundle()
Determines if an entity type and/or bundle show be included.
Parameters
string $entity_type_id: The entity type id.
string|null $bundle_name: The bundle name.
Return value
bool True if the entity type or bundle should be included.
4 calls to OpenApiGeneratorBase::includeEntityTypeBundle()
- JsonApiGenerator::getDefinitions in src/
Plugin/ openapi/ OpenApiGenerator/ JsonApiGenerator.php - Get model definitions for Drupal entities and bundles.
- JsonApiGenerator::getPaths in src/
Plugin/ openapi/ OpenApiGenerator/ JsonApiGenerator.php - Returns the paths information.
- JsonApiGenerator::getTags in src/
Plugin/ openapi/ OpenApiGenerator/ JsonApiGenerator.php - Get tags for schema.
- RestGenerator::getTags in src/
Plugin/ openapi/ OpenApiGenerator/ RestGenerator.php - Get tags.
File
- src/
Plugin/ openapi/ OpenApiGeneratorBase.php, line 569
Class
- OpenApiGeneratorBase
- Defines base class for OpenApi Generator plugins.
Namespace
Drupal\openapi\Plugin\openapiCode
protected function includeEntityTypeBundle($entity_type_id, $bundle_name = NULL) {
// Entity types or a specific bundle be can excluded.
if (isset($this->options['exclude'])) {
if (array_intersect([
$entity_type_id,
$this
->getEntityDefinitionKey($entity_type_id, $bundle_name),
], $this->options['exclude'])) {
return FALSE;
}
}
if (isset($this->options['entity_mode'])) {
$entity_type = $this->entityTypeManager
->getDefinition($entity_type_id);
if ($this->options['entity_mode'] == 'content_entities') {
return $entity_type instanceof ContentEntityTypeInterface;
}
if ($this->options['entity_mode'] == 'config_entities') {
return $entity_type instanceof ConfigEntityTypeInterface;
}
}
if (isset($this->options['entity_type_id']) && $this->options['entity_type_id'] !== $entity_type_id) {
return FALSE;
}
if (isset($bundle_name) && isset($this->options['bundle_name']) && $this->options['bundle_name'] !== $bundle_name) {
return FALSE;
}
return TRUE;
}