You are here

public function ResourceType::__construct in JSON:API 8

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

Instantiates a ResourceType object.

Parameters

string $entity_type_id: An entity type ID.

string $bundle: A bundle.

string $deserialization_target_class: The deserialization target class.

bool $internal: (optional) Whether the resource type should be internal.

bool $is_locatable: (optional) Whether the resource type is locatable.

File

src/ResourceType/ResourceType.php, line 212

Class

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

Namespace

Drupal\jsonapi\ResourceType

Code

public function __construct($entity_type_id, $bundle, $deserialization_target_class, $internal = FALSE, $is_locatable = TRUE) {
  $this->entityTypeId = $entity_type_id;
  $this->bundle = $bundle;
  $this->deserializationTargetClass = $deserialization_target_class;
  $this->internal = $internal;
  $this->isLocatable = $is_locatable;
  $this->typeName = sprintf('%s--%s', $this->entityTypeId, $this->bundle);
}