Question 1) Is this a good use of a static class?
Question 2) Thoughts on my class?
Question 3) Any thoughts on why i run this code i get the error " classes that i write Fatal error: Call to undefined method Notify::sendNotification() in classes/testclass.php on line 5"
Code: Select all
class Notify {
private $email = "email@awesomesauce.com";
private $phone = "";
private $sms;
private $subject;
private $message;
public static function sendNotifiction($subject, $message, $sms) {
self::$subject = $subject;
self::$message = $message;
self::$sms = $sms;
}
private function sendEmail() {
mail(self::$email, self::$subject, self::$message);
if (self::$sms) {
mail(self::$phone, self::$subject, self::$message);
}
}
}Code: Select all
Notify::sendNotification("testing subject","testing message", true);