protected function EntityReferenceFieldNormalizer::isInternalResourceType in JSON:API 8
Determines if the given entity is of an internal resource type.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for which to check the internal status.
Return value
bool TRUE if the entity's resource type is internal, FALSE otherwise.
1 call to EntityReferenceFieldNormalizer::isInternalResourceType()
- EntityReferenceFieldNormalizer::normalize in src/
Normalizer/ EntityReferenceFieldNormalizer.php - Normalizes an object into a set of arrays/scalars.
File
- src/
Normalizer/ EntityReferenceFieldNormalizer.php, line 253
Class
- EntityReferenceFieldNormalizer
- Normalizer class specific for entity reference field objects.
Namespace
Drupal\jsonapi\NormalizerCode
protected function isInternalResourceType(EntityInterface $entity) {
return ($resource_type = $this->resourceTypeRepository
->get($entity
->getEntityTypeId(), $entity
->bundle())) && $resource_type
->isInternal();
}