added DataMapper Example

This commit is contained in:
kbariotis
2013-05-13 20:40:21 +03:00
parent 4ff0def140
commit 73cd3bf9cd
3 changed files with 73 additions and 47 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace DesignPatterns;
/**
* DataMapper pattern
*
* Testing the DataMapper Pattern
*/
$userMapper = new UserMapper();
$user = $userMapper->find(1);
if ($user !== null) {
echo "Hello " . $user->getUsername() . ". Your email is " . $user->getEmail();
}
?>