Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 76 | All time: 10,169 This week: 660 |
Version | License | PHP version | Categories | |||
datamapper 0.0.0 | The PHP License | 8 | Data types, Validation, PHP 8 |
Class for mapping data by filters
composer require alexmcarrow/datamapper
use AlexMcArrow\DataMapper\DataMapper;
new DataMapper();
DataMapper::setFieldsFilter([
'key' => 'KeyID',
'name' => 'User Name'
]);
$rawdata = [
[
'key' => 'a1',
'name' => 'Alex',
'email' => 'alex@domain.tld'
],
[
'key' => 'b2',
'name' => 'Axel'
]
];
$cleardata = DataMapper::parseMapData($rawdata, DataMapper::$FILTER_PASS_CUT, DataMapper::$FILTER_TYPE_HARD, DataMapper::$MAP_KEY, DataMapper::$MAP_VALUE);
print_r($cleardata);
[
[
'keyid' => 'a1',
'user name' => 'Alex'
],
[
'keyid' => 'b2',
'user name' => 'Axel'
]
]
MIT
Files (7) |
File | Role | Description | ||
---|---|---|---|---|
src (1 file) | ||||
tests (1 file) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
psalm.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.