Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. interface DataMapperInterface
  2. {
  3. public function find($params);
  4. public function save($object);
  5. public function delete($object);
  6. }
  7.  
  8. class DataMapper_User implements DataMapperInterface
  9. {
  10. public function find($params)
  11. {
  12. //Execute code to retrieve data from data source
  13. return someDataRetrievalMethod($params);
  14. }
  15.  
  16. public function save($object)
  17. {
  18. throw new Exception('Method not yet implemented.');
  19. }
  20.  
  21. public function delete($object)
  22. {
  23. throw new Exception('Method not yet implemented.');
  24. }
  25. }
  26.  
  27. interface DataMapperInterface
  28. {
  29. public function find($params);
  30. public function save($object);
  31. public function delete($object);
  32. }
  33.  
  34. abstract class DataMapper_User implements DataMapperInterface
  35. {
  36. public function find($params)
  37. {
  38. //Execute code to retrieve data from data source
  39. return someDataRetrievalMethod($params);
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement