public static function objectsToJson($objectArray)
    {
        $tmp = [];
        foreach ($objectArray as $key => $item){
            if (is_object($item) || is_array($item)) {
                $item = json_encode($item);
            }
            $tmp[$key] = $item;
        }
        return $tmp;
    }