src/Controllers/ResourceController.php
public function toEntity(
        RESTResource $resource,
        Context $context,
        $existingEntity = null,
        $resourceDefinition = null,
        $entityFactory = null
    ) {
        $resourceDefinition = $resourceDefinition ?? $this->resourceDefinition;
        $entityFactory = $entityFactory ?? new EntityFactory();

        return $this->resourceTransformer->toEntity(
            $resource,
            $resourceDefinition,
            $entityFactory,
            $context,
            $existingEntity
        );
    }
public function toEntity(
        RESTResource $resource,
        Context $context,
        $existingEntity = null,
        $resourceDefinition = null,
        $entityFactory = null
    ) {
        $resourceDefinition = $resourceDefinition ?? $this->resourceDefinition;
        $entityFactory = $entityFactory ?? new EntityFactory();

        return $this->resourceTransformer->toEntity(
            $resource,
            $resourceDefinition,
            $entityFactory,
            $context,
            $existingEntity
        );
    }
Transform a resource into (an existing?) entity.
@param RESTResource $resource
@param Context $context
@param null $existingEntity
@param null $resourceDefinition
@param null $entityFactory
@return mixed