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


PHP model::model方法代碼示例

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


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

示例1: NOW

 function __construct()
 {
     parent::model();
     $this->load->helper('crosswords');
     $this->load->model('comments_model');
     $this->load->model('businesscards_model');
     // Snippets of useful sql
     $this->overdue_sql = '((`crossword_deadline` IS NOT NULL ' . '	AND `crossword_deadline`    <= NOW()) ' . 'OR (`crossword_publication` IS NOT NULL ' . '	AND `crossword_publication` <= NOW() ' . '	AND `crossword_completeness` != 100))';
     $this->published_sql = '(`crossword_publication` IS NOT NULL ' . 'AND `crossword_publication` <= NOW() ' . 'AND `crossword_completeness` = 100)';
     $this->scheduled_sql = '(`crossword_publication` IS NOT NULL ' . 'AND NOT ' . $this->published_sql . ')';
     $this->winner_count_sql = '(SELECT COUNT(*) ' . 'FROM `crossword_winners` ' . 'WHERE `crossword_winner_crossword_id` = `crossword_id`)';
     $this->expired_sql = '((`crossword_expiry` IS NOT NULL AND `crossword_expiry` <= NOW()) ' . 'OR	' . $this->winner_count_sql . ' >= `crossword_winners`)';
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:13,代碼來源:crosswords_model.php

示例2: __construct

 public function __construct()
 {
     parent::model();
     session_start();
     $this->load->model('organisation_model');
     // Check if we already have login details
     if (isset($_SESSION['ua_loggedin'])) {
         $this->isLoggedIn = $_SESSION['ua_loggedin'];
         $this->username = $_SESSION['ua_username'];
         $this->isUni = $_SESSION['ua_username'];
         $this->entityId = $_SESSION['ua_entityId'];
         $this->isUser = $_SESSION['ua_isuser'];
         if (array_key_exists('ua_timeformat', $_SESSION)) {
             $this->timeFormat = $_SESSION['ua_timeformat'];
         }
         $this->officeLogin = $_SESSION['ua_hasoffice'];
         $this->officeType = $_SESSION['ua_officetype'];
         $this->officeInterface = $_SESSION['ua_officeinterface'];
         $this->firstname = $_SESSION['ua_firstname'];
         $this->surname = $_SESSION['ua_surname'];
         $this->permissions = $_SESSION['ua_permissions'];
         $this->organisationLogin = $_SESSION['ua_organisation'];
         $this->organisationName = $_SESSION['ua_organisationname'];
         $this->organisationShortName = $_SESSION['ua_organisationshortname'];
         $this->allTeams = $_SESSION['ua_allteams'];
         $this->salt = $_SESSION['ua_salt'];
     }
     if (!$this->isLoggedIn && isset($_COOKIE['SavedLogin'])) {
         // Try to perform the login from a cookie
         try {
             $details = explode(':$:', $_COOKIE['SavedLogin']);
             if (count($details) == 2) {
                 // We have a username and has, login
                 $this->loginByHash($details[0], $details[1], true);
             } elseif (count($details) == 1) {
                 // We just have the username
                 $this->username = $details[0];
             }
         } catch (Exception $e) {
             // Failing is fine
         }
     }
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:43,代碼來源:user_auth.php

示例3:

 function __construct()
 {
     parent::model();
     $this->load->library('academic_calendar');
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:5,代碼來源:recurrence_model.php

示例4:

 function __construct()
 {
     parent::model();
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:4,代碼來源:comments_model.php

示例5:

 /**
  * @param $Structure array URI processing structure.
  */
 function __construct($Structure)
 {
     parent::model();
     // Initialise
     $this->mStructure = $Structure;
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:9,代碼來源:uri_tree_subcontroller.php

示例6:

 function __construct()
 {
     parent::model();
     $this->load->model('organisation_model');
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:5,代碼來源:notices_model.php

示例7:

 function __construct()
 {
     parent::model();
     $this->load->helper('uri_tail');
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:5,代碼來源:calendar_actions.php

示例8:

 function __construct()
 {
     parent::model();
     $this->load->helper('uri_tail');
     $this->load->model('calendar/calendar_actions');
 }
開發者ID:TheYorkerArchive,項目名稱:codebase-2006-2012,代碼行數:6,代碼來源:organiser_actions.php


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