public static function groupArray($arr, $groupField)
    {
        $result = array();
        foreach ($arr as $data) {
            $id = $data[$groupField];
            if (isset($result[$id])) {
                $result[$id][] = $data;
            } else {
                $result[$id] = array($data);
            }
        }

        return $result;
    }