Recommend this page to a friend! |
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
Classes of Alex McArrow | > | PHP Data Mapper | > | Download .zip .tar.gz | > | Support forum | > | Blog | > | Latest changes |
|
Groups | Applications | Files |
Groups |
Data types | Modeling and manipulating data types | View top rated classes |
Validation | Validation algorithms | View top rated classes |
PHP 8 | Classes using PHP 8 specific features | View top rated classes |
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Files |
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 |
Download all files: datamapper.tar.gz datamapper.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|
Files |
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 |
Download all files: datamapper.tar.gz datamapper.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|