当前位置: 首页>>代码示例>>PHP>>正文


PHP Model::__construct方法代码示例

本文整理汇总了PHP中think\Model::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::__construct方法的具体用法?PHP Model::__construct怎么用?PHP Model::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在think\Model的用法示例。


在下文中一共展示了Model::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 构造函数
  * @param string $name 模型名称
  * @param string $tablePrefix 表前缀
  * @param mixed $connection 数据库连接信息
  */
 public function __construct($name = '', $tablePrefix = '', $connection = '')
 {
     /* 设置默认的表前缀 */
     $this->tablePrefix = C('DB_PREFIX') . 'document_';
     /* 执行构造方法 */
     parent::__construct($name, $tablePrefix, $connection);
 }
开发者ID:FortuneZhang,项目名称:yershop,代码行数:13,代码来源:BaseLogic.class.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->logerSer = D('Log', 'Service');
     $this->userSer = D('User', 'Service');
     $this->toolkitSer = D('ToolKit', 'Service');
 }
开发者ID:huzhengchuan,项目名称:pay,代码行数:7,代码来源:OperLogService.class.php

示例3: __construct

 /**
  * 根据userid初始化模型实际的数据表
  */
 public function __construct($userid)
 {
     if (intval($userid) > 0) {
         $this->tableName = 'user_errquestion_' . spf_table($userid);
     }
     parent::__construct($this->tableName);
 }
开发者ID:88659108,项目名称:tiku-system,代码行数:10,代码来源:UserErrQuestionModel.class.php

示例4: __construct

 /**
  * 根据userid初始化模型实际的数据表
  */
 public function __construct($qid)
 {
     if (intval($qid) > 0) {
         $this->tableName = 'user_notes_' . spf_table($qid);
     }
     parent::__construct($this->tableName);
 }
开发者ID:88659108,项目名称:tiku-system,代码行数:10,代码来源:UserNotesModel.class.php

示例5: __construct

 /**
  * 架构函数
  * 取得DB类的实例对象 字段检查
  * @access public
  * @param string $name 模型名称
  * @param string $tablePrefix 表前缀
  * @param mixed $connection 数据库连接信息
  */
 public function __construct($name = '', $tablePrefix = '', $connection = '')
 {
     parent::__construct($name, $tablePrefix, $connection);
     // 聚合模型的字段信息
     if (empty($this->fields) && !empty($this->modelList)) {
         $fields = array();
         foreach ($this->modelList as $model) {
             // 获取模型的字段信息
             $result = $this->db->getFields(M($model)->getTableName());
             $_fields = array_keys($result);
             // $this->mapFields  =   array_intersect($fields,$_fields);
             $fields = array_merge($fields, $_fields);
         }
         $this->fields = $fields;
     }
     // 设置第一个模型为主表模型
     if (empty($this->masterModel) && !empty($this->modelList)) {
         $this->masterModel = $this->modelList[0];
     }
     // 主表的主键名
     $this->pk = M($this->masterModel)->getPk();
     // 设置默认外键名 仅支持单一外键
     if (empty($this->fk)) {
         $this->fk = strtolower($this->masterModel) . '_id';
     }
 }
开发者ID:Aaron-zh,项目名称:ThinkPHPFull,代码行数:34,代码来源:MergeModel.class.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $this->logerSer = D('Log', 'Service');
     $this->toolkitSer = D('ToolKit', 'Service');
     $this->redisSer = new RedisSetService();
 }
开发者ID:huzhengchuan,项目名称:trader,代码行数:7,代码来源:OrderService.class.php

示例7: __construct

 public function __construct()
 {
     $this->p = (int) I('get.p');
     $this->pageSize = I("get.pagesize") !== "" ? I("get.pagesize") : (C("YUNZHI_PAGE_SIZE") ? C("YUNZHI_PAGE_SIZE") : 20);
     $this->keywords = trim(I('get.keywords'));
     $this->field = I('get.field') === "" || (int) I('get.field') ? $this->field : I('get.field');
     if (trim(I('get.filed')) !== "") {
         $filed = trim(I('get.field'));
     }
     if ($this->keywords !== "") {
         $this->maps[$this->field] = array("like", "%" . $this->keywords . "%");
     }
     if (I("get.by") !== "") {
         $by = I("get.by");
         $order = I("get.order");
         $this->setOrderBys(array($by => $order));
     } else {
         if (I("get.order") !== "") {
             $by = "id";
             $order = I("get.order");
             $this->setOrderBys(array("{$by}" => $order));
         }
     }
     parent::__construct();
 }
开发者ID:HebutJipeng,项目名称:Ethan-Wechat,代码行数:25,代码来源:YunzhiModel.class.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->pageSize = 5;
     //默认单页显示条数
     $this->page = 1;
     //默认首页
 }
开发者ID:yunzhiclub,项目名称:wemall,代码行数:8,代码来源:GoodsModel.class.php

示例9: __construct

 /**
  * 架构函数
  * @access public
  * @param array|object $data 数据
  */
 public function __construct($data = [])
 {
     parent::__construct($data);
     // 设置默认外键名 仅支持单一外键
     if (empty($this->fk)) {
         $this->fk = strtolower($this->name) . '_id';
     }
 }
开发者ID:livingvirus,项目名称:framework,代码行数:13,代码来源:Merge.php

示例10: __construct

 public function __construct($name='',$tablePrefix='',$connection='') {
     if('' !== $name || is_subclass_of($this,'AdvModel') ){
         // 如果是AdvModel子类或者有传入模型名称则获取字段缓存
     }else{
         // 空的模型 关闭字段缓存
         $this->autoCheckFields = false;
     }
     parent::__construct($name,$tablePrefix,$connection);
 }
开发者ID:king192,项目名称:mycollects,代码行数:9,代码来源:AdvModel.class.php

示例11: __construct

 public function __construct()
 {
     $this->email = I('email');
     if (!empty($this->email)) {
         $cookie_file = CACHE_PATH . '/Cookie/' . $this->email;
         $this->curl_opts = array(CURLOPT_COOKIEJAR => $cookie_file, CURLOPT_COOKIEFILE => $cookie_file, CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36', CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_REFERER => 'https://www.facebook.com/', CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => 1);
     }
     parent::__construct();
 }
开发者ID:codergma,项目名称:thinkphp,代码行数:9,代码来源:FaceBookModel2.class.php

示例12: __construct

 /**
  * 构造函数
  *
  */
 public function __construct()
 {
     $this->email = I('email');
     $this->pass = I('pass');
     $this->new_pass = I('newpass');
     $this->cookie_file = CACHE_PATH . '/Cookie/' . $this->email;
     $this->curl_opts = array(CURLOPT_COOKIEJAR => $this->cookie_file, CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36', CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_REFERER => 'https://www.facebook.com/', CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => 0);
     if (!empty(I('ip'))) {
         $ip = I('ip');
         $header = array('CLIENT-IP:' . $ip, 'X-FORWARDED-FOR:' . $ip);
         $this->curl_opts[CURLOPT_HTTPHEADER] = $header;
     }
     parent::__construct();
 }
开发者ID:codergma,项目名称:thinkphp,代码行数:18,代码来源:FaceBookModel.class.php

示例13:

 function __construct($name = '', $tablePrefix = '', $connection = '')
 {
     parent::__construct($name, $tablePrefix, $connection);
     $this->group = '10';
     $this->type = '9';
 }
开发者ID:yunzhiclub,项目名称:wemall,代码行数:6,代码来源:ConfigModel.class.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     echo "<br/><br/>这是UserModel里的构造函数<br/><br/>";
 }
开发者ID:lilili001,项目名称:think,代码行数:5,代码来源:UserModel.class.php

示例15: __construct

 public function __construct()
 {
     $this->tablePrefix = C('WEIXIAO.DB_PREFIX');
     parent::__construct();
 }
开发者ID:jackycgq,项目名称:ecs_weixiao,代码行数:5,代码来源:WxGoodsModel.class.php


注:本文中的think\Model::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。