public static function all(array $where = [], string $table = "", bool $setRelations = true) : array
    {
        $query = new QueryBuilder(self::$_connection);
        $model = new static();

        $query->select("*");

        if($table === "") {
            $query->from($model->getTable());
        } else {
            $query->from($table);
        }

        $query = static::_setWhere($where, $query, $model->_primaryKey);

        $result = $query->execute();
        $return = [];

        foreach($result as $r) {
            $model = new static($r, $setRelations);
            if($table !== "") {
                $model->_table = $table;
            }

            $return[] = $model;
        }

        return $return;
    }