public function transformResultToArray($receivedResult)
    {
        // transform object to array
        if (is_object($receivedResult)) {
            return json_decode(json_encode($receivedResult), true);
        // transform json string to array
        } else {
            return json_decode($receivedResult, true);
        }
    }