<?php
namespace App\Model;

use ActiveRecord\Errors;
use ActiveRecord\Model;
abstract class GenericObject extends Model
{
    static $connection = 'pro';

    public abstract function cargar($data);

    public static function group_by($data_array,$group_by)
    {
        $grouped_array = array();
        foreach ($data_array as $element) {
            $grouped_array[$element[$group_by]][] = $element;
        }
        return $grouped_array;
    }
}