Guest User

Untitled

a guest
Jan 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2.  
  3. class My_Service {
  4. function create($data) {
  5. try {
  6. $this->getDao()->getMapper()->insert($data);
  7. } catch(Exception $e) {
  8. // How should I handle this exception?
  9. }
  10. }
  11. }
  12.  
  13. class My_Controller {
  14. function indexAction() {
  15. $service = new My_Service();
  16. if($service->create(array())) {
  17. //display specific error
  18. };
  19. }
  20. }
Add Comment
Please, Sign In to add comment