PHPackages                             dertechie/datamapping - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dertechie/datamapping

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dertechie/datamapping
=====================

Der Techie Data Mapping library for a consistent way of coping around with Data Mapping.

10PHP

Since Nov 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/DerTechie/datamapping)[ Packagist](https://packagist.org/packages/dertechie/datamapping)[ RSS](/packages/dertechie-datamapping/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

About Der Techie - DataMapping
==============================

[](#about-der-techie---datamapping)

In modern PHP Applications there is often a need for coping with data mappings. Many applications use class methods like `fromArray` or `fromXXX` on their Models / Entities. This might work for built-in types like array or objects in the same context. But as soon as someone tries to map from an object out of context, things get messy.

This library provides a clean and decoupled way to cope with Data Mappings.

Installation
============

[](#installation)

The preferred method of installation is via Composer. The following command will add the appropriate requirement to your composer.json:

`composer require dertechie/datamapping`

Using the Library
=================

[](#using-the-library)

Let's assume we have a simple Object that we want to map:

```
