public function entityFromBody($body, $entity)
    {
        $json = $this->decodeJson($body);
        return $entity->populate($json);
    }
public function entityFromBody($body, $entity)
    {
        $json = $this->decodeJson($body);
        return $entity->populate($json);
    }
public function entityFromBody ( $ body , $ entity ) { $ json = $ this -> decodeJson ( $ body ) ; return $ entity -> populate ( $ json ) ; }
Populate an entity from request or response body

@param string $body
@param Entity $entity
@return Entity
Populate an entity from request or response body