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


PHP SiteModel::getDescriptionText方法代碼示例

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


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

示例1: update

 /**
  * @param SiteModel $site
  * @param $fields
  * @param UserAccountModel $user As opposed to other DBAccess classes, User can not be NULL.
  * @throws Exception
  * @throws \Exception
  */
 public function update(SiteModel $site, $fields, UserAccountModel $user)
 {
     $alreadyInTransaction = $this->db->inTransaction();
     // Make Information Data
     $fieldsSQL1 = array();
     $fieldsParams1 = array('id' => $site->getId());
     foreach ($fields as $field) {
         $fieldsSQL1[] = " " . $field . "=:" . $field . " ";
         if ($field == 'title') {
             $fieldsParams1['title'] = substr($site->getTitle(), 0, VARCHAR_COLUMN_LENGTH_USED);
         } else {
             if ($field == 'slug') {
                 $fieldsParams1['slug'] = substr($site->getSlug(), 0, VARCHAR_COLUMN_LENGTH_USED);
                 $fieldsSQL1[] = " slug_canonical=:slug_canonical ";
                 $fieldsParams1['slug_canonical'] = substr(SiteModel::makeCanonicalSlug($site->getSlug()), 0, VARCHAR_COLUMN_LENGTH_USED);
             } else {
                 if ($field == 'description_text') {
                     $fieldsParams1['description_text'] = $site->getDescriptionText();
                 } else {
                     if ($field == 'footer_text') {
                         $fieldsParams1['footer_text'] = $site->getFooterText();
                     } else {
                         if ($field == 'is_web_robots_allowed') {
                             $fieldsParams1['is_web_robots_allowed'] = $site->getIsWebRobotsAllowed() ? 1 : 0;
                         } else {
                             if ($field == 'is_closed_by_sys_admin') {
                                 $fieldsParams1['is_closed_by_sys_admin'] = $site->getIsClosedBySysAdmin() ? 1 : 0;
                             } else {
                                 if ($field == 'closed_by_sys_admin_reason') {
                                     $fieldsParams1['closed_by_sys_admin_reason'] = $site->getClosedBySysAdminReason();
                                 } else {
                                     if ($field == 'is_listed_in_index') {
                                         $fieldsParams1['is_listed_in_index'] = $site->getIsListedInIndex() ? 1 : 0;
                                     } else {
                                         if ($field == 'prompt_emails_days_in_advance') {
                                             $fieldsParams1['prompt_emails_days_in_advance'] = $site->getPromptEmailsDaysInAdvance();
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // Make History Data
     $fieldsSQL2 = array('site_id', 'user_account_id', 'created_at');
     $fieldsSQLParams2 = array(':site_id', ':user_account_id', ':created_at');
     $fieldsParams2 = array('site_id' => $site->getId(), 'user_account_id' => $user ? $user->getId() : null, 'created_at' => $this->timesource->getFormattedForDataBase());
     foreach ($this->possibleFields as $field) {
         if (in_array($field, $fields) || $field == 'title') {
             $fieldsSQL2[] = " " . $field . " ";
             $fieldsSQLParams2[] = " :" . $field . " ";
             if ($field == 'title') {
                 $fieldsParams2['title'] = substr($site->getTitle(), 0, VARCHAR_COLUMN_LENGTH_USED);
             } else {
                 if ($field == 'slug') {
                     $fieldsParams2['slug'] = substr($site->getSlug(), 0, VARCHAR_COLUMN_LENGTH_USED);
                     $fieldsSQL2[] = " slug_canonical  ";
                     $fieldsSQLParams2[] = " :slug_canonical  ";
                     $fieldsParams2['slug_canonical'] = substr(SiteModel::makeCanonicalSlug($site->getSlug()), 0, VARCHAR_COLUMN_LENGTH_USED);
                 } else {
                     if ($field == 'description_text') {
                         $fieldsParams2['description_text'] = $site->getDescriptionText();
                     } else {
                         if ($field == 'footer_text') {
                             $fieldsParams2['footer_text'] = $site->getFooterText();
                         } else {
                             if ($field == 'is_web_robots_allowed') {
                                 $fieldsParams2['is_web_robots_allowed'] = $site->getIsWebRobotsAllowed() ? 1 : 0;
                             } else {
                                 if ($field == 'is_closed_by_sys_admin') {
                                     $fieldsParams2['is_closed_by_sys_admin'] = $site->getIsClosedBySysAdmin() ? 1 : 0;
                                 } else {
                                     if ($field == 'closed_by_sys_admin_reason') {
                                         $fieldsParams2['closed_by_sys_admin_reason'] = $site->getClosedBySysAdminReason();
                                     } else {
                                         if ($field == 'is_listed_in_index') {
                                             $fieldsParams2['is_listed_in_index'] = $site->getIsListedInIndex() ? 1 : 0;
                                         } else {
                                             if ($field == 'prompt_emails_days_in_advance') {
                                                 $fieldsParams2['prompt_emails_days_in_advance'] = $site->getPromptEmailsDaysInAdvance();
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             $fieldsSQL2[] = " " . $field . "_changed ";
//.........這裏部分代碼省略.........
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:101,代碼來源:SiteDBAccess.php


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