public function getData(DbManagement $db, $query, $params, DbManagementObject $DbManagementObject)
    {       
        $keys = $DbManagementObject->getKeys();

        //parse params to check their validity and 
        //use the conventions to sort and filter results
        $parsed = $this->parseParams($params, $keys, $DbManagementObject->getTypes());
        
        $array=[];

        //if valid params have been detected
        //query is filled in with arguments
        if(isset($parsed)){
            foreach ($parsed as $type => $values) {
                switch($type){
                    case "min":
                        foreach ($values as $key => $val) {
                            $min = $keys[$key]."-min";
                            $db->sortMin($query,$keys[$key],$min);
                            $array[]=$val;
                        }
                        break;
                    case "max":
                        foreach ($values as $key => $val) {
                            $max = $keys[$key]."-max";
                            $db->sortMax($query,$keys[$key],$max);
                            $array[]=$val;
                        }
                        break;
                    case "up":
                        foreach ($values as $val) {
                            $db->orderUp($query,$keys[$val]);
                        }
                        break;
                    case "down":
                        foreach ($values as $val) {
                            $db->orderDown($query,$keys[$val]);
                        }
                        break;
                    case "equals":
                        foreach ($values as $key => $val) {
                            $db->sort($query,$keys[$key], $keys[$key]);
                            $array[]=$val;
                        }
                        break;
                }
            }
        }

        //close query
        $db->closeQuery($query);

        $answer = $db->query($query, $array);

        $args=[];
        while ($row = $answer->fetch(\PDO::FETCH_ASSOC)) {
            foreach ($keys as $key => $val) {
                $argsDbManagementObject[$val]=$row[$val];
            }
            $args[] = $argsDbManagementObject;
        }

        return $args;
    }