From d830516882eaf5a3b164a55e8262b8481ed85cb9 Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Wed, 2 Jun 2010 15:48:50 +0000 Subject: [PATCH] Adding a few PHPDoc blocks. --- library/App/Model/ApprovalActionInterface.php | 7 +++++ library/App/RequestNotification.php | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/library/App/Model/ApprovalActionInterface.php b/library/App/Model/ApprovalActionInterface.php index da3a2f14..6b49d295 100644 --- a/library/App/Model/ApprovalActionInterface.php +++ b/library/App/Model/ApprovalActionInterface.php @@ -1,5 +1,12 @@ <?php +/** + * Provides an interface for creating additional Approval Action types. + * An approval action represents a point at which some entity may potentially + * modify a request and then make a decision about the request (by modifying + * its status). A Model implementing this interface will be a child of Unl_Model. + */ + interface App_Model_ApprovalActionInterface { /** diff --git a/library/App/RequestNotification.php b/library/App/RequestNotification.php index f3fdb4bd..1702ac3a 100644 --- a/library/App/RequestNotification.php +++ b/library/App/RequestNotification.php @@ -1,9 +1,24 @@ <?php +/** + * This class handles the generation and scheduling of email notifications + * that alert users of requests that are pending their decisions. + */ + class App_RequestNotification { + /** + * Stores the list of notifications once it has been generated to avoid + * needlessly reproccessing it. + * + * @var array + */ static protected $_notifications; + /** + * Does the work of processing which users have pending requests and populates + * $_notifications with the list. + */ static protected function _loadNotifications() { if (Unl_Util::isArray(self::$_notifications)) { @@ -81,6 +96,10 @@ class App_RequestNotification } } + /** + * Prints out a simple list of the notifications in plain text. + * Mainly useful when debugging. + */ public static function listNotifications() { self::_loadNotifications(); @@ -93,6 +112,9 @@ class App_RequestNotification } } + /** + * Sends out an email to each user who has pending requests. + */ public static function sendNotifications() { self::_loadNotifications(); @@ -150,6 +172,10 @@ EOF } } + /** + * Sends out email notifications, then schedules itself to be called again in two days. + * This should really only be called by a cron job. + */ public static function scheduledNotifications() { self::sendNotifications(); -- GitLab