Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d8f6e6f2

Přidáno uživatelem Jakub Vašta před asi 4 roky(ů)

Re #8094
+ method for retrieving all dates with at least one dataset

Zobrazit rozdíly:

website/src/OpenDataManager.php
60 60
        return !empty($result);
61 61
    }
62 62

  
63
    public function getDatesWithAvailableCollection() {
64
        $command = new Command(['listCollections' => 1]);
65
        $result = $this->manager->executeCommand('open-data-db', $command)->toArray();
66

  
67
        $dates = [];
68
        foreach ($result as $value) {
69
            if (preg_match('/\\d{4}-\\d{2}-\\d{2}/', $value->name)) {
70
                array_push($dates, substr($value->name, -10));
71
            }
72
        }
73

  
74
        return array_values(array_unique($dates));
75
    }
76

  
63 77
    public function getMaxCollectionNumberAtDay($name, $date) {
64 78
        $max = $this->manager->executeQuery('open-data-db.'.$name.$date, new Query([], ['sort' => ['number' => -1], 'limit' => 1]));
65 79

  

Také k dispozici: Unified diff