protected function prepareResult($data, $isObject)
    {
        $output = [];

        if (is_null($data) || is_scalar($data)) {
            return $data;
        }

        if ($this->isMultiArray($data)) {
            foreach ($data as $key => $val) {
                $val = $this->takeColumn($val);
                $output[$key] = $isObject ? (object) $val : $val;
            }
        } else {
            $output = json_decode(json_encode($this->takeColumn($data)), $isObject);
        }

        return $output;
    }