public function ResourceIdentifier::getResourceType in Drupal 9
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/JsonApiResource/ResourceIdentifier.php \Drupal\jsonapi\JsonApiResource\ResourceIdentifier::getResourceType()
Gets the resource identifier's JSON:API resource type.
Return value
\Drupal\jsonapi\ResourceType\ResourceType The JSON:API resource type.
Overrides ResourceIdentifierInterface::getResourceType
1 call to ResourceIdentifier::getResourceType()
- ResourceIdentifier::withArity in core/
modules/ jsonapi/ src/ JsonApiResource/ ResourceIdentifier.php - Returns a copy of the given ResourceIdentifier with the given arity.
File
- core/
modules/ jsonapi/ src/ JsonApiResource/ ResourceIdentifier.php, line 104
Class
- ResourceIdentifier
- Represents a JSON:API resource identifier object.
Namespace
Drupal\jsonapi\JsonApiResourceCode
public function getResourceType() {
if (!isset($this->resourceType)) {
/** @var \Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface $resource_type_repository */
$resource_type_repository = \Drupal::service('jsonapi.resource_type.repository');
$this->resourceType = $resource_type_repository
->getByTypeName($this
->getTypeName());
}
return $this->resourceType;
}