mouf / database.datasource.datasource-interface
This package only contains basic interfaces for implementing data sources.
Installs: 3 733
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 2
Open Issues: 1
Type:mouf-library
Requires
- php: >=5.4
- mouf/utils.value.value-interface: ^1.0
Requires (Dev)
- phpunit/phpunit: ~4.5
- satooshi/php-coveralls: ^0.6.1
README
Datasources for Mouf
You can find in this package two very useful interfaces:
DataSourceInterface
: a DataSource that represents an array of arraysRowInterface
: a Row that is the representation of a key indexed array.
Known implementations
- MagicQuery (TODO)
This packages contains 2 very basic implementations of these interfaces:
- The
Row
class maps a key indexed array into aRowInterface
- The
DataSource
class maps an array of array into aDataSourceInterface
Modifiers
This package comes with a set of utility classes to transform rows and datasources:
RowMapper
creates an "output" row from an "input" row and a set ofPickers
(implementing thePickerInterface
)ArrayMapper
creates an "output" datasource from an "input" datasource and a set ofPickers
(implementing thePickerInterface
)
This package comes with 2 pickers (implementing the PickerInterface
):
RowPicker
: selects one value in a rowCallbackPicker
: applies a callback function to a row and returns the value of the callback
Finally, the RowBuilder
class can be used to merge rows, add a row as a key of a row or to add datasources as keys of a row.