public function EntityTypeInfo::isAmpEnabledType in Accelerated Mobile Pages (AMP) 8.2
Same name and namespace in other branches
- 8.3 src/EntityTypeInfo.php \Drupal\amp\EntityTypeInfo::isAmpEnabledType()
- 8 src/EntityTypeInfo.php \Drupal\amp\EntityTypeInfo::isAmpEnabledType()
Checks if AMP is enabled for this bundle.
Parameters
string $node_type: The node type to check whether AMP is enabled or not.
Return value
bool TRUE if AMP is enabled for this bundle. FALSE otherwise.
File
- src/
EntityTypeInfo.php, line 51
Class
- EntityTypeInfo
- Service class for retrieving and manipulating entity type information.
Namespace
Drupal\ampCode
public function isAmpEnabledType($node_type) {
$amp_display = $this->entityTypeManager
->getStorage('entity_view_display')
->load('node.' . $node_type . '.amp');
if ($amp_display && $amp_display
->status()) {
return TRUE;
}
return FALSE;
}