get('type'); if (empty($notif_type)) { return null; } // compose the notification type class $base_notif_class = 'VBONotificationDisplay'; $type_class = ucwords(str_replace(array('-', '_'), ' ', $notif_type)); $type_class = preg_replace("/[^a-zA-Z0-9]/", '', $type_class); $notif_class_name = $base_notif_class . $type_class; if (!class_exists($notif_class_name)) { return null; } // return an instance of the apposite displayer by re-binding the payload return $notif_class_name::getInstance($this->getProperties()); } }