PHP code example of jerodev / data-mapper

1. Go to this page and download the library: Download jerodev/data-mapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jerodev / data-mapper example snippets


class User
{
    public int $id;
    public string $name;
}

$mapper = new \Jerodev\DataMapper\Mapper();
$entity = $mapper->map(User::class, [
    'id' => '5',
    'name' => 'John Doe',
]);

//    User {
//        +id: 5,
//        +name: "John Doe",
//    }