示例#1
0
 /**
  * @param string $relationship
  * @param \WoohooLabs\Yin\JsonApi\Request\RequestInterface $request
  * @param \WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface $exceptionFactory
  * @param mixed $domainObject
  * @return mixed
  * @throws \WoohooLabs\Yin\JsonApi\Exception\RelationshipNotExists
  */
 public function hydrateForRelationshipUpdate($relationship, RequestInterface $request, ExceptionFactoryInterface $exceptionFactory, $domainObject)
 {
     $relationshipHydrators = $this->getRelationshipHydrator($domainObject);
     if (isset($relationshipHydrators[$relationship]) === false) {
         throw $exceptionFactory->createRelationshipNotExists($relationship);
     }
     $relationshipHydrator = $relationshipHydrators[$relationship];
     return $this->doHydrateRelationship($domainObject, $relationship, $relationshipHydrator, $exceptionFactory, $request->getParsedBody(), $request->getResource());
 }