Skip to content

Instantly share code, notes, and snippets.

@augustohp
Created November 23, 2011 13:01
Show Gist options
  • Save augustohp/1388614 to your computer and use it in GitHub Desktop.
Save augustohp/1388614 to your computer and use it in GitHub Desktop.
Data Mapper use case
<?php
$map = array('id'=>'id', 'login'=>'login', 'passwd'=>'passwd');
$origin = array('id'=>1, 'login'=>'foo', 'passwd'=>'bar');
$mapper = new Respect\Data\Mapper($map);
$object = new StdClass;
$mapper->toInstance($origin, $object);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment