• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Base_Model类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Base_Model的典型用法代码示例。如果您正苦于以下问题:PHP Base_Model类的具体用法?PHP Base_Model怎么用?PHP Base_Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: update_user_role

 function update_user_role($user_id, $role_ids)
 {
     $this->_db()->delete('user_role', array('user_id' => $user_id));
     if (!empty($role_ids)) {
         if (!is_array($role_ids)) {
             $role_ids = array($role_ids);
         }
         foreach ($role_ids as $role_id) {
             if (!empty($role_id)) {
                 $role_id = empty($role_id) ? 0 : $role_id;
                 $user_role = array('user_id' => $user_id, 'role_id' => $role_id);
                 Base_Model::before_save($user_role);
                 $this->_db()->insert('user_role', $user_role);
             }
         }
     }
 }
开发者ID:rip-projects,项目名称:ark-php,代码行数:17,代码来源:base_user_model.php


示例2: update_tag

 function update_tag($tags, $id)
 {
     $CI =& get_instance();
     if (!is_array($tags)) {
         $tags = array($tags);
     }
     $this->db->where(array($this->_name . '_id' => $id));
     $this->db->delete('tag_' . $this->_name);
     foreach ($tags as $tag) {
         if (!empty($tag)) {
             $tag_id = $CI->_model('tag')->add($tag);
             if (!empty($tag_id)) {
                 $obj_tag = array('tag_id' => $tag_id, $this->_name . '_id' => $id);
                 Base_Model::before_save($obj_tag);
                 $this->db->insert('tag_' . $this->_name, $obj_tag);
             }
         }
     }
 }
开发者ID:rip-projects,项目名称:judge,代码行数:19,代码来源:base_model.php


示例3:

 function __construct()
 {
     parent::__construct();
     $this->init("anggota", "id", "nomor_anggota");
     $this->load->model("pinjaman");
     $this->load->model("tabungan");
 }
开发者ID:ibnoe,项目名称:kosimpin,代码行数:7,代码来源:anggota.php


示例4: __construct

 public function __construct()
 {
     $this->db_tablepre = 't_wechat_';
     // 不设置默认为t_sys_
     $this->table_name = 'config';
     parent::__construct();
 }
开发者ID:wqzgh,项目名称:gt_basic,代码行数:7,代码来源:WeChat_model.php


示例5: __construct

 public function __construct()
 {
     $this->db_tablepre = 'ci_';
     $this->table_name = 'game_rank';
     parent::__construct();
     $this->mode_table_name = $this->table_name;
 }
开发者ID:q546530715,项目名称:ACI-CodeIgnter,代码行数:7,代码来源:Oauth_model.php


示例6: __construct

 /**
  * Constructs a Question_Type_Model while setting attribute types.
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     //setting attribute types.
     settype($this->id, "integer");
     settype($this->name, "string");
 }
开发者ID:nilupull,项目名称:Advanced_Web_Technology_Coursework_1,代码行数:11,代码来源:Question_Type_Model.php


示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $this->users_table = "users";
     $this->roles_table = "roles";
     $this->zones_table = "zones";
     $this->areas_table = "areas";
     $this->brands_table = "brands";
     $this->profiles_table = "profiles";
     $this->credit_limit_table = "credit_limit";
 }
开发者ID:ujjalsuttradhar,项目名称:ci_boilerplate_management,代码行数:11,代码来源:user_model.php


示例8: paginate

 public function paginate($page = 1, $where = array(), $limit = 10)
 {
     // get filtered results
     $where = array_merge($where, $this->where);
     $offset = $page <= 1 ? 0 : ($page - 1) * $limit;
     $this->db->limit($limit, $offset);
     $results = parent::get_many_by($where);
     // get counts (e.g. for pagination)
     $count_results = count($results);
     $count_total = parent::count_by($where);
     $total_pages = ceil($count_total / $limit);
     $counts = array('from_num' => $count_results == 0 ? 0 : $offset + 1, 'to_num' => $count_results == 0 ? 0 : $offset + $count_results, 'total_num' => $count_total, 'curr_page' => $page, 'total_pages' => $count_results == 0 ? 1 : $total_pages, 'limit' => $limit);
     return array('data' => $results, 'counts' => $counts);
 }
开发者ID:TowerX,项目名称:ci_bootstrap_3,代码行数:14,代码来源:MY_Model.php


示例9:

 function __construct()
 {
     parent::__construct();
     // Setup allowed tables
     $this->load->config('khaos', true, true);
     $options = $this->config->item('acl', 'khaos');
     $this->_TABLES = $options['tables'];
     $this->_TABLES['groups'] = $this->config->item('backendpro_table_prefix') . "groups";
     $this->_TABLES['resources'] = $this->config->item('backendpro_table_prefix') . "resources";
     // Setup ACO Model
     $this->resource = new Nested_sets_model();
     $this->resource->setControlParams($this->_TABLES['acos']);
     $this->resource->setPrimaryKeyColumn('id');
     // Setup ARO Model
     $this->group = new Nested_sets_model();
     $this->group->setControlParams("n_" . $this->_TABLES['aros']);
     $this->group->setPrimaryKeyColumn('id');
     log_message('debug', 'BackendPro : Access_control_model class loaded');
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:19,代码来源:access_control_model.php


示例10: paginate

 public function paginate($page = 1, $where = array(), $limit = NULL)
 {
     // decide per-page limit by: 1) $this->limit; 2) a default value (10)
     if (!empty($this->limit) && $limit === NULL) {
         $limit = $this->limit;
     } else {
         if ($limit === NULL) {
             $limit = 10;
         }
     }
     // avoid overrided by $this->limit
     $this->limit = NULL;
     // get filtered results
     $where = array_merge($where, $this->where);
     $offset = $page <= 1 ? 0 : ($page - 1) * $limit;
     $this->db->limit($limit, $offset);
     $results = parent::get_many_by($where);
     // get counts (e.g. for pagination)
     $count_results = count($results);
     $count_total = parent::count_by($where);
     $total_pages = ceil($count_total / $limit);
     $counts = array('from_num' => $count_results == 0 ? 0 : $offset + 1, 'to_num' => $count_results == 0 ? 0 : $offset + $count_results, 'total_num' => $count_total, 'curr_page' => $page, 'total_pages' => $count_results == 0 ? 1 : $total_pages, 'limit' => $limit);
     return array('data' => $results, 'counts' => $counts);
 }
开发者ID:jothamhernandez,项目名称:PT_HIFI,代码行数:24,代码来源:MY_Model.php


示例11: __construct

 public function __construct()
 {
     parent::__construct('article_cat');
 }
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:4,代码来源:Article_cat_model.php


示例12:

 function __construct()
 {
     parent::__construct('players', 'player');
 }
开发者ID:comp4711-Assignment,项目名称:Assignment,代码行数:4,代码来源:Players.php


示例13:

 function __construct()
 {
     $this->db_tablepre = 'tb_';
     $this->table_name = 'member_role_priv';
     parent::__construct();
 }
开发者ID:sharpmental,项目名称:prcs,代码行数:6,代码来源:Member_role_priv_model.php


示例14: __construct

 public function __construct()
 {
     parent::__construct();
     $this->loadConnection('default');
     $this->logger->write('info', 'model: Agama');
 }
开发者ID:nmadipati,项目名称:si-ksc,代码行数:6,代码来源:agama_model.php


示例15: __construct

 public function __construct()
 {
     parent::__construct();
 }
开发者ID:skubbs-chuck,项目名称:emr,代码行数:4,代码来源:Model_session.php


示例16: __construct

 public function __construct()
 {
     parent::__construct();
     $this->table_name = "tb_alarm_mon";
 }
开发者ID:sharpmental,项目名称:prcs,代码行数:5,代码来源:Alarm_mon_model.php


示例17: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_path = isset($this->name) ? base_url() . DIR_APPS . '/' . DIR_APP . '/modules/' . $this->name . '/' : false;
     $this->_localPath = isset($this->name) ? $this->name . DS : false;
 }
开发者ID:skubbs-chuck,项目名称:emr,代码行数:6,代码来源:Module.php


示例18: __construct

	/**
	 * __construct : ctor
	 * 
	 * @access public
	 * @return void
	 */
	public function __construct() {
		parent::__construct();
		$this->load->database();
	}
开发者ID:robinmin,项目名称:MyContact,代码行数:10,代码来源:Sys_Model.php


示例19: __construct

 /**
  * Tracker Model Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->set_table('tracker');
 }
开发者ID:pompalini,项目名称:emngo,代码行数:10,代码来源:tracker_model.php


示例20: __construct

 /**
  * Article Model Constructor
  *
  * @access	public
  */
 public function __construct()
 {
     // Call the Model constructor
     parent::__construct();
 }
开发者ID:pompalini,项目名称:emngo,代码行数:10,代码来源:structure_model.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Base_ThemeCommon类代码示例发布时间:2022-05-23
下一篇:
PHP Base_Controller类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap