コード例 #1
0
 public function parseEditData($postArr)
 {
     $emailNotificationObjs = null;
     if (isset($postArr['notificationMessageStatus']) && is_array($postArr['notificationMessageStatus'])) {
         for ($i = 0; $i < count($postArr['notificationMessageStatus']); $i++) {
             $tmpEmailNotificationObj = new EmailNotificationConfiguration($_SESSION['user']);
             if (!isset($postArr['notificationMessageStatus'][$i])) {
                 $postArr['notificationMessageStatus'][$i] = 0;
             }
             $tmpEmailNotificationObj->setUserId($_SESSION['user']);
             $tmpEmailNotificationObj->setEmail($postArr['txtMailAddress']);
             $tmpEmailNotificationObj->setNotifcationTypeId($postArr['notificationMessageId'][$i]);
             $tmpEmailNotificationObj->setNotificationStatus($postArr['notificationMessageStatus'][$i]);
             $emailNotificationObjs[] = $tmpEmailNotificationObj;
         }
     }
     return $emailNotificationObjs;
 }
 private function _buildObjArr($result)
 {
     if (!isset($result)) {
         return false;
     }
     $objArr = null;
     $userObj = new Users();
     while ($row = mysql_fetch_assoc($result)) {
         $tmpEmailNotificationConf = new EmailNotificationConfiguration($row['user_id']);
         $tmpEmailNotificationConf->setNotifcationTypeId($row['notification_type_id']);
         $tmpEmailNotificationConf->setNotificationStatus($row['status']);
         $email = $userObj->fetchUserEmail($row['user_id']);
         $tmpEmailNotificationConf->setEmail($email);
         $objArr[] = $tmpEmailNotificationConf;
     }
     return $objArr;
 }