More tests, filtering iterator, cleanup

This commit is contained in:
2022-10-31 02:58:34 +01:00
parent d0956f851c
commit fd2767b642
14 changed files with 340 additions and 21 deletions

View File

@ -45,3 +45,39 @@ foreach ($reader as $row) {
// row is an array
}
```
# Documentation
## DatasetManager
The `DatasetManager` will automatically locate and load datasets on startup.
```
getDataset(string $identifier): Dataset
Return a Dataset object, or throw exception on error
openDataset(string $identifer): Iterator
Return a reader for a Dataset, same as getDataset()->open()
getAvailableDatasets(): array
Returns the Dataset objects for all datasets found
```
## Dataset
```
open(): Iterator
Return an iterator to iterate over the data
filter(array|callable $condition): Iterator
Return an iterator that only returns rows matching filter
getIdentifier(): string
Return the dataset identifier (vendor/package#dataset)
getVersion(): string
Return the package version of the dataset
getPackageName(): string
Return the package name (vendor/package)
getDatasetName(): string
Return the dataset name (dataset)
getLicense(): ?string
Return the license for the dataset
getComment(): ?string
Return the dataset comment
```