You are here

public function ResourceObjectToEntityMapper::createEntityFromResourceObject in JSON:API Resources 8

Creates a new entity from the given resource object.

Parameters

\Drupal\jsonapi\JsonApiResource\ResourceObject $resource_object: The resource object from which to create a new entity.

Return value

\Drupal\Core\Entity\EntityInterface The newly created entity.

File

src/Unstable/Entity/ResourceObjectToEntityMapper.php, line 53

Class

ResourceObjectToEntityMapper
Service which maps a resource object into an entity.

Namespace

Drupal\jsonapi_resources\Unstable\Entity

Code

public function createEntityFromResourceObject(ResourceObject $resource_object) {
  return $this
    ->mapResourceObjectToEntity($resource_object);
}