You are here

public function ResourceType::getRelatableResourceTypes in JSON:API 8

Same name and namespace in other branches
  1. 8.2 src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getRelatableResourceTypes()

Get all resource types with which this type may have a relationship.

Return value

array The relatable resource types, keyed by relationship field names.

See also

self::setRelatableResourceTypes()

1 call to ResourceType::getRelatableResourceTypes()
ResourceType::getRelatableResourceTypesByField in src/ResourceType/ResourceType.php
Get all resource types with which the given field may have a relationship.

File

src/ResourceType/ResourceType.php, line 243

Class

ResourceType
Value object containing all metadata for a JSON API resource type.

Namespace

Drupal\jsonapi\ResourceType

Code

public function getRelatableResourceTypes() {
  if (!isset($this->relatableResourceTypes)) {
    throw new \LogicException("setRelatableResourceTypes() must be called before getting relatable resource types.");
  }
  return $this->relatableResourceTypes;
}