New code comments.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 14 Dec 2017 21:41:24 +0000 (16:41 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 14 Dec 2017 21:41:24 +0000 (16:41 -0500)
Commenting more of the code for notification types.

models/admin/settings/notificationTypes.php

index 6dc403d..bd362b3 100644 (file)
@@ -144,6 +144,13 @@ class GlmMembersAdmin_settings_notificationTypes extends GlmDataNotificationType
 
         switch( $option ) {
         case 'test':
+            /**
+             * test:
+             *
+             * Test the notification email.
+             * Currently this is just using a hard coded account id  of 1.
+             * After the test it will call wp_die
+             */
             echo '<pre>$_REQUEST: ' . print_r( $_REQUEST, true ) . '</pre>';
             require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH .  '/notifications.php';
             $Notifications = new GlmNotifications( $this->wpdb, $this->config );
@@ -156,12 +163,24 @@ class GlmMembersAdmin_settings_notificationTypes extends GlmDataNotificationType
             }
             wp_die('Testing here');
             break;
+
         case 'add':
+            /**
+             * add:
+             *
+             * This calls the dataabstract newEntry method and sets up the
+             * edit for for creating a new notification_type.
+             */
             $notification = $this->newEntry();
             $view = 'editNotificationType';
             break;
 
         case 'insert':
+            /**
+             * insert:
+             *
+             * Calls the insertEntry method that stores the actual data for the data abstract class.
+             */
             $view = 'editNotificationType';
             $notification = $this->insertEntry();
             if ( $notification['status'] ) {
@@ -174,11 +193,21 @@ class GlmMembersAdmin_settings_notificationTypes extends GlmDataNotificationType
             break;
 
         case 'edit':
+            /**
+             * edit:
+             *
+             * Calls the editEntry method to setup the edit form for this record by id.
+             */
             $notification = $this->editEntry( $id );
             $view = 'editNotificationType';
             break;
 
         case 'update':
+            /**
+             * update:
+             *
+             * Calls the updateEntry method for the data abstract to save the edit data.
+             */
             if ($id > 0) {
                 $notification = $this->updateEntry($id);
                 if ( $notification['status'] ) {
@@ -193,6 +222,12 @@ class GlmMembersAdmin_settings_notificationTypes extends GlmDataNotificationType
             break;
 
         case 'delete':
+            /**
+             * delete:
+             *
+             * Calls the delete entry method of the dataabstract class.
+             * To delete the given entry by id.
+             */
             if ($id > 0) {
                 $this->deleteEntry($id, true);
             }