當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Subscriber::setComment方法代碼示例

本文整理匯總了PHP中Subscriber::setComment方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subscriber::setComment方法的具體用法?PHP Subscriber::setComment怎麽用?PHP Subscriber::setComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subscriber的用法示例。


在下文中一共展示了Subscriber::setComment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: pre_process


//.........這裏部分代碼省略.........
             $subscr_help_email_trim = trim($_POST['subscr_help_email']);
             $this->form_data['subscr_help_email'] = Input::sanitizeEmail($subscr_help_email_trim);
             if ($this->form_data['subscr_help_email'] != $subscr_help_email_trim) {
                 $this->form_data['subscr_help_email'] = "";
                 $this->form_data['subscr_help_email_invalid'] = true;
                 $this->displayInvalidCharError($subscr_help_email_trim, $this->form_data['subscr_help_email'], 'l10n_label_helpdeskemail');
                 $this->validationErrors = true;
             }
         }
         /* subscr_help_email */
         /* don't continue, if data was stripped due to the field
          * sanitation */
         if ($this->validationErrors) {
             return;
         }
         switch (htmlentities($_POST['subscriber'])) {
             case 'edit':
                 $subscriber = null;
                 if ($this->person->getSubscriber()->hasDBID($id)) {
                     $subscriber = $this->person->getSubscriber();
                 } else {
                     /* Other subscruber than user's
                      * subscriber, must create new object
                      * from DB */
                     $subscriber = Subscriber::getSubscriberByID($id, $this->person->getNREN());
                 }
                 if (!is_null($subscriber)) {
                     /* subscriber will clean input */
                     $update = $subscriber->setState($state);
                     $update |= $subscriber->setEmail($this->form_data['subscr_email']);
                     $update |= $subscriber->setPhone($this->form_data['subscr_phone']);
                     $update |= $subscriber->setRespName($this->form_data['subscr_responsible_name']);
                     $update |= $subscriber->setRespEmail($this->form_data['subscr_responsible_email']);
                     $update |= $subscriber->setComment($this->form_data['subscr_comment']);
                     $update |= $subscriber->setHelpURL($this->form_data['subscr_help_url']);
                     $update |= $subscriber->setHelpEmail($this->form_data['subscr_help_email']);
                     if ($update) {
                         if (!$subscriber->save(true)) {
                             Framework::error_output($this->translateTag('l10n_fail_editsubs1', 'nrenadmin'));
                         } else {
                             Framework::success_output($this->translateTag('l10n_suc_editsubs1', 'nrenadmin'));
                         }
                     }
                     /* show info-list for subscriber */
                     $this->tpl->assign('subscr_details', Subscriber::getSubscriberByID($id, $this->person->GetNREN())->getInfo());
                     $this->tpl->assign('subscriber_details', true);
                     $this->tpl->assign('subscriber_detail_id', $id);
                 }
                 break;
             case 'editState':
                 $subscriber = null;
                 if ($this->person->getSubscriber()->hasDBID($id)) {
                     $subscriber = $this->person->getSubscriber();
                 } else {
                     $subscriber = Subscriber::getSubscriberByID($id, $this->person->getNREN());
                 }
                 if (!is_null($subscriber)) {
                     if ($subscriber->setState($state)) {
                         if (!$subscriber->save(true)) {
                             Framework::error_output("Could not update state of subscriber. Is the database-layer broken?");
                             Framework::error_output($this->translateTag("l10n_fail_edit_subscr_state", "nrenadmin"));
                         }
                     }
                 }
                 break;
             case 'info':
開發者ID:henrikau,項目名稱:confusa,代碼行數:67,代碼來源:nren_admin.php

示例2: getSubscriberList

 /**
  * get the list of subscribers for that NREN
  *
  * @param void
  * @return array<Subscriber> the subscribers signed up to this NREN
  * @since Confusa v0.4-rc0
  * @access public
  */
 public function getSubscriberList($orderBy = 'subscriber_id')
 {
     $subscribers = null;
     $query = "SELECT subscriber_id, name, org_state, lang, subscr_email, ";
     $query .= "subscr_phone, subscr_resp_name, subscr_resp_email, ";
     $query .= "subscr_comment, dn_name FROM subscribers WHERE nren_id=?\n\t\tORDER BY trim({$orderBy})";
     $res = MDB2Wrapper::execute($query, array('integer'), array($this->getID()));
     if (count($res) > 0) {
         foreach ($res as $row) {
             $subs = new Subscriber($row['name'], $this->getName(), $row['dn_name'], $row['org_state'], $row['subscriber_id']);
             $subs->setEmail($row['subscr_email']);
             $subs->setPhone($row['subscr_phone']);
             $subs->setRespName($row['subscr_resp_name']);
             $subs->setRespEmail($row['subscr_resp_email']);
             $subs->setComment($row['subscr_comment']);
             $subscribers[] = $subs;
         }
     }
     return $subscribers;
 }
開發者ID:henrikau,項目名稱:confusa,代碼行數:28,代碼來源:NREN.php


注:本文中的Subscriber::setComment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。