Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 77 This week: 1 | All time: 10,162 This week: 42![]() |
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
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
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. |
![]() |
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.