2017 © Pedro Peláez
 

library cartograph

Map objects to objects

image

frank-houweling/cartograph

Map objects to objects

  • Tuesday, July 10, 2018
  • by FrankHouweling
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,969 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 78 % Grown

The README.md

Cartograph

This library is used to Map PHP object to other objects, (*1)

Installation

Install this library using composer, (*2)

composer require frank-houweling/cartograph

Getting Started

To use this library create an instance of the MapperService, using your preffered MappingRepositoryInterface, (*3)

<?php
use FrankHouweling\Cartograph\MapperService;
use FrankHouweling\Cartograph\Mapping\DirectMapping;
use FrankHouweling\Cartograph\MappingRepository;

$foo = new Foo();
$bar = new Bar();

// Initiate the MapperService
$mappingRepository = new MappingRepository();
$mapperService = new MapperService($mappingRepository);

// Register a mapping from Foo, to Bar using the DirectMapping
$mappingRepository->addMapping(Foo::class, Bar::class, DirectMapping::class);

// Map Foo -> Bar. Will fetch the previously registered Mapping
$mapperService->map($foo, $bar);

Creating custom Mappings

The DirectMapping uses reflection to map attributes 1:1. Should this not meet your requirements, you can create a custom mapping by implementing the MappingInterface and registering it to the MappingRepository as shown above., (*4)

The Versions

10/07 2018

dev-master

9999999-dev http://www.senet.nl/

Map objects to objects

  Sources   Download

GPL-2.0

The Requires

 

php mapping object mapping

10/07 2018

1.0.1

1.0.1.0 http://www.senet.nl/

Map objects to objects

  Sources   Download

GPL-2.0

The Requires

 

php mapping object mapping

10/07 2018

2.0.1

2.0.1.0 http://www.senet.nl/

Map objects to objects

  Sources   Download

GPL-2.0

The Requires

 

php mapping object mapping

09/07 2018

2.0.0

2.0.0.0 http://www.senet.nl/

Map objects to objects

  Sources   Download

GPL-2.0

The Requires

 

php mapping object mapping

12/09 2017

1.0.0

1.0.0.0 http://www.senet.nl/

Map objects to objects

  Sources   Download

GPL-2.0

The Requires

  • php ^7.1

 

php mapping object mapping