Last active
August 29, 2015 14:14
-
-
Save amacgregor/27e6048d8f969ec59d30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class NotificationManager { | |
public function sendNotification($type = '', $data) | |
{ | |
switch($type){ | |
case "email": | |
$notification = new EmailAdapter(); | |
break; | |
case "twitter": | |
$notification = new TwitterAdapter(); | |
break; | |
case "sms": | |
$notification = new SmsAdapter(); | |
break; | |
default: | |
// Do something to log an exception | |
return false; | |
break; | |
} | |
$notification->setData($data); | |
$notification->sendNotification(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment