<?php
/**
 * Form SMS Notifications List
 *
 * @package miniorange-sms-order-notification-otp-verification/notifications/formsmsnotification/helper
 */

namespace WCSMSOTP\Notifications\FormSMSNotification\Helper;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
use WCSMSOTP\Notifications\FormSMSNotification\Helper\Notifications\CF7FormSubmitionNotification;
use WCSMSOTP\Notifications\FormSMSNotification\Helper\Notifications\WPFormsSubmissionNotification;
use WCSMSOTP\Notifications\FormSMSNotification\Helper\Notifications\NinjaFormSubmissionNotification;
use WCSMSOTP\Traits\Instance;

/**
 * This class is used to list down all the Form SMS Notifications and initialize
 * each of the Notification classes so that it's accessible plugin wide. This
 * class is basically used to handle all the specific Form SMS Notification classes.
 */
if ( ! class_exists( 'FormSMSNotificationsList' ) ) {
	/**
	 * FormSMSNotificationsList class
	 */
	class FormSMSNotificationsList {

		/**
		 * New customer notification class
		 *
		 * @var CF7FormSubmitionNotification
		 */
		public $mo_contact_form7_notif;

		/**
		 * New User Admin Notification
		 *
		 * @var WPFormsSubmissionNotification
		 */
		public $mo_wpform_notif;

		/**
		 * New customer notification class
		 *
		 * @var NinjaFormSubmissionNotification
		 */
		public $mo_ninja_form_notif;

		use Instance;

		/**
		 * Initializes values
		 */
		protected function __construct() {

			$this->mo_contact_form7_notif = CF7FormSubmitionNotification::getInstance();
			$this->mo_wpform_notif        = WPFormsSubmissionNotification::getInstance();
			$this->mo_ninja_form_notif    = NinjaFormSubmissionNotification::getInstance();
		}


		/**
		 * Getter function of the $mo_contact_form7_notif. Returns the instance
		 * of the CF7FormSubmitionNotification class.
		 *
		 * @return CF7FormSubmitionNotification|null
		 */
		public function get_mo_contact_form7_notif() {
			return isset( $this->mo_contact_form7_notif ) && is_object( $this->mo_contact_form7_notif )
				? $this->mo_contact_form7_notif
				: null;
		}

		/**
		 * Getter function of the $mo_wpform_notif. Returns the instance
		 * of the WPFormsSubmissionNotification class.
		 *
		 * @return WPFormsSubmissionNotification|null
		 */
		public function get_mo_wpform_notif() {
			return isset( $this->mo_wpform_notif ) && is_object( $this->mo_wpform_notif )
				? $this->mo_wpform_notif
				: null;
		}

		/**
		 * Getter function of the $mo_ninja_form_notif. Returns the instance
		 * of the NinjaFormSubmissionNotification class.
		 *
		 * @return NinjaFormSubmissionNotification|null
		 */
		public function get_mo_ninja_form_notif() {
			return isset( $this->mo_ninja_form_notif ) && is_object( $this->mo_ninja_form_notif )
				? $this->mo_ninja_form_notif
				: null;
		}
	}
}
