Skip to content

Instantly share code, notes, and snippets.

@amacgregor
Last active August 29, 2015 14:14
Show Gist options
  • Save amacgregor/27e6048d8f969ec59d30 to your computer and use it in GitHub Desktop.
Save amacgregor/27e6048d8f969ec59d30 to your computer and use it in GitHub Desktop.
<?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