PHPackages                             jimmy4fingers/simple-data-mapper - 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. jimmy4fingers/simple-data-mapper

ActiveLibrary

jimmy4fingers/simple-data-mapper
================================

Data mapping class

0.0.3(7y ago)08PHPPHP &gt;=7

Since Jul 24Pushed 3mo agoCompare

[ Source](https://github.com/jimmy4fingers/simple-data-mapper)[ Packagist](https://packagist.org/packages/jimmy4fingers/simple-data-mapper)[ RSS](/packages/jimmy4fingers-simple-data-mapper/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Simple Data Mapper
==================

[](#simple-data-mapper)

[![Build Status](https://camo.githubusercontent.com/bc93291ecb7c6f353a9987dfd730f5ec56ca7fe4f95a45e9975f63e3177bfc3c/68747470733a2f2f6170692e7472617669732d63692e636f6d2f6a696d6d793466696e676572732f73696d706c652d646174612d6d61707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/jimmy4fingers/simple-data-mapper)

A lightweight PHP package that implements the Data Mapper pattern to convert raw data into application objects while keeping concerns cleanly separated.

Problem
-------

[](#problem)

In a legacy CodeIgniter application with no dependency injection, form handling logic was hard-coded, tightly coupled, and spread across large controllers. Form data structures were difficult to reuse or modify, and there was no clean way to sanitize, clean, or tweak inputs before submission.

What it does
------------

[](#what-it-does)

This package allows you to define complete form data as objects and apply any number of transformation functions to clean or modify values before submission. It centralizes form data mapping and processing, improving flexibility and maintainability without requiring changes to the underlying framework.

Collection of objects intended to cut down repetition of code when having to re-map arrays of data with another source (DB field's etc.)

E.g:

```
