public function hydrate(JsonApiRequestInterface $request, ExceptionFactoryInterface $exceptionFactory, $domainObject)
    {
        if ($request->getMethod() === "POST") {
            $domainObject = $this->hydrateForCreate($request, $exceptionFactory, $domainObject);
        } elseif ($request->getMethod() === "PATCH") {
            $domainObject = $this->hydrateForUpdate($request, $exceptionFactory, $domainObject);
        }

        return $domainObject;
    }
public function hydrate(JsonApiRequestInterface $request, ExceptionFactoryInterface $exceptionFactory, $domainObject)
    {
        if ($request->getMethod() === "POST") {
            $domainObject = $this->hydrateForCreate($request, $exceptionFactory, $domainObject);
        } elseif ($request->getMethod() === "PATCH") {
            $domainObject = $this->hydrateForUpdate($request, $exceptionFactory, $domainObject);
        }

        return $domainObject;
    }
public function hydrate ( JsonApiRequestInterface $ request , ExceptionFactoryInterface $ exceptionFactory , $ domainObject ) { if ( $ request -> getMethod ( ) === "POST" ) { $ domainObject = $ this -> hydrateForCreate ( $ request , $ exceptionFactory , $ domainObject ) ; } elseif ( $ request -> getMethod ( ) === "PATCH" ) { $ domainObject = $ this -> hydrateForUpdate ( $ request , $ exceptionFactory , $ domainObject ) ; } return $ domainObject ; }
Hydrates the domain object from the request based on the request method.

If the request method is POST then the domain object is hydrated
as a create. If it is a PATCH request then the domain object is
hydrated as an update.
@param mixed $domainObject
@return mixed
@throws ResourceTypeMissing|JsonApiExceptionInterface
Hydrates the domain object from the request based on the request method .