function ResourceTypeRelationship::withRelatableResourceTypes
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php \Drupal\jsonapi\ResourceType\ResourceTypeRelationship::withRelatableResourceTypes()
- 10 core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php \Drupal\jsonapi\ResourceType\ResourceTypeRelationship::withRelatableResourceTypes()
- 11.x core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php \Drupal\jsonapi\ResourceType\ResourceTypeRelationship::withRelatableResourceTypes()
Establishes the relatable resource types of this field.
Parameters
array $resource_types: The array of relatable resource types.
Return value
static A new instance of the field with the given relatable resource types.
File
-
core/
modules/ jsonapi/ src/ ResourceType/ ResourceTypeRelationship.php, line 34
Class
- ResourceTypeRelationship
- Specialization of a ResourceTypeField to represent a resource relationship.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function withRelatableResourceTypes(array $resource_types) {
$relationship = new static($this->internalName, $this->publicName, $this->enabled, $this->hasOne);
$relationship->relatableResourceTypes = $resource_types;
return $relationship;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.