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


PHP LSActiveRecord::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * @param string $scenario
  * @param int $iSurveyId
  */
 public function __construct($iSurveyId = null, $scenario = 'insert')
 {
     if (!isset($iSurveyId)) {
         $iSurveyId = Response::getLastSurveyId();
     }
     $this->surveyId = $iSurveyId;
     parent::__construct($scenario);
 }
開發者ID:mfavetti,項目名稱:LimeSurvey,代碼行數:12,代碼來源:Timing.php

示例2: __construct

 /**
  * @param string $scenario
  * @param string $sTableName
  */
 public function __construct($sTableName = null, $scenario = 'insert')
 {
     if (!isset($sTableName)) {
         //Yii::trace('sTableName missing.');
         throw new Exception('sTableName missing.');
     }
     $this->tableName = $sTableName;
     parent::__construct($scenario);
 }
開發者ID:jdbaltazar,項目名稱:survey-office,代碼行數:13,代碼來源:PluginDynamic.php

示例3: __construct

 /**
  * See example usage at manual page: https://manual.limesurvey.org/Notifications#Examples
  * @param array<string, mixed>|string|null $options If string then scenario
  */
 public function __construct($options = null)
 {
     // Don't do anything if this is called from self::model()
     if (is_string($options) || is_null($options)) {
         parent::__construct($options);
         // $options = scenario in this case
         return;
     } else {
         // Why not Zoidberg? (\/) (°,,,°) (\/)
         parent::__construct();
     }
     $options = $this->checkShortcuts($options);
     $this->checkMandatoryFields($options, array('entity', 'entity_id', 'title', 'message'));
     // Only allow 'survey' or 'user' as entity
     if ($options['entity'] != 'survey' && $options['entity'] != 'user') {
         throw new InvalidArgumentException('Invalid entity: ' . $options['entity']);
     }
     // Default to 'default' display class
     if (!isset($options['display_class'])) {
         $options['display_class'] = 'default';
     }
     // Default to 'log' notification importance
     if (!isset($options['importance'])) {
         $options['importance'] = self::NORMAL_IMPORTANCE;
     }
     // importance must be between 1 and 3
     if ($options['importance'] < 1 && $options['importance'] > 3) {
         throw new InvalidArgumentException('Invalid importance: ' . $options['importance']);
     }
     // Set everything up
     $this->entity = $options['entity'];
     $this->entity_id = $options['entity_id'];
     $this->title = $options['title'];
     $this->message = $options['message'];
     $this->display_class = $options['display_class'];
     $this->importance = $options['importance'];
     $this->status = 'new';
     $this->created = date('Y-m-d H:i:s', time());
     $this->first_read = null;
 }
開發者ID:mfavetti,項目名稱:LimeSurvey,代碼行數:44,代碼來源:Notification.php

示例4: __construct

 public function __construct($scenario = 'insert')
 {
     list(, $this->dynamicId) = explode('_', get_class($this));
     parent::__construct($scenario);
 }
開發者ID:mfavetti,項目名稱:LimeSurvey,代碼行數:5,代碼來源:Dynamic.php


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