示例#1
0
 /**
  * @param string $model
  *
  * @return mixed
  */
 function Model($model = 'codefight', $config = FALSE)
 {
     if (!is_object('MY_Model')) {
         include_once APPPATH . DS . 'core' . DS . 'MY_Model.php';
     }
     //$CI =& get_instance();
     $MY_Model = new MY_Model();
     //$CI->model('MY_Model');
     return $MY_Model->Model($model, $config);
     //return $MY_Model->Model($model);
 }
示例#2
0
 /**
  * Return an RDF object based an a $row
  */
 public function rdf($row, $prefix = '')
 {
     $row->type = isset($row->type) ? $row->type : 'version';
     if (isset($row->url)) {
         if (!is_array($row->url)) {
             $row->url = array($row->url);
         }
         foreach ($row->url as $key => $value) {
             if (!isURL($value)) {
                 $row->url[$key] = abs_url($value, $prefix);
             }
         }
     }
     $rdf = parent::rdf($row, $prefix);
     // Blend with RDF from the semantic store
     if (!empty($row->rdf)) {
         foreach ($row->rdf as $p => $values) {
             if (array_key_exists($p, $rdf)) {
                 // TODO: Not sure we should allow a collision between the semantic and relational tables? For now, don't.
             } else {
                 $rdf[$p] = $values;
             }
         }
     }
     return $rdf;
 }
 function __construct()
 {
     parent::__construct();
     $this->table_nom = 'utilisateurs';
     $this->cle_primaire = 'ID';
     $this->table_order = '';
 }
 function load($value, $by = 'id', $except_value = '', $except_by = 'id')
 {
     $row = parent::load($value, $by, $except_value, $except_by);
     $eRol = new eRol();
     $eRol->parseRow($row);
     return $eRol;
 }
示例#5
0
 function __construct()
 {
     parent::__construct();
     $this->timestamps = FALSE;
     // rules
     $this->rules = ['insert' => ['name' => ['field' => 'name', 'label' => lang('menu.form.name'), 'rules' => 'required|trim|xss_clean'], 'active' => ['field' => 'active', 'label' => lang('menu.form.active'), 'rules' => 'trim|xss_clean'], 'position' => ['field' => 'position', 'label' => lang('menu.form.position'), 'rules' => 'trim|xss_clean']], 'update' => ['name' => ['field' => 'name', 'label' => lang('menu.form.name'), 'rules' => 'required|trim|xss_clean'], 'active' => ['field' => 'active', 'label' => lang('menu.form.active'), 'rules' => 'trim|xss_clean'], 'position' => ['field' => 'position', 'label' => lang('menu.form.position'), 'rules' => 'trim|xss_clean']]];
 }
 function __construct()
 {
     include BLOG_PATH . 'config/blog.php';
     $tables = $config['tables'];
     parent::__construct($tables['blog_settings']);
     // table name
 }
 public function validate()
 {
     $this->form_validation->set_rules('email_template_title', $this->lang->line('email_template_title'), 'required');
     $this->form_validation->set_rules('email_template_body', $this->lang->line('email_body'));
     $this->form_validation->set_rules('email_template_footer', $this->lang->line('email_footer'));
     return parent::validate();
 }
 function load($value, $by = 'id', $except_value = '', $except_by = 'id')
 {
     $row = parent::load($value, $by, $except_value, $except_by);
     $ePermission = new ePermission();
     $ePermission->parseRow($row);
     return $ePermission;
 }
 public function __construct()
 {
     $this->table = 'user_details';
     $this->primary_key = 'user_id';
     $this->has_one['user'] = '******';
     parent::__construct();
 }
示例#10
0
	/**
	 * Check name
	 *
     * @access	public
	 * @param	string	$name
	 * @param	id		$id
	 * @return	bool
	 */
    public function check_name($name = '', $id = 0)
    {
    	return (int) parent::count_by(array(
			'id !='	=>	$id,
			'name'	=>	$name
		)) > 0;
    }
示例#11
0
 function load($value, $by = 'id', $except_value = '', $except_by = 'id')
 {
     $row = parent::load($value, $by, $except_value, $except_by);
     $ePais = new ePais();
     $ePais->parseRow($row);
     return $ePais;
 }
 public function __construct()
 {
     parent::__construct();
     $this->banco = $this->config->item('dbFabricaPinheiro');
     $this->tabela = $this->config->item('tblBlogsCategorias');
     $this->apelido = 'blc';
 }
示例#13
0
 public function __construct()
 {
     parent::MY_Model();
     $this->primary_key = "id";
     $this->table_name = "solicitacao";
     $this->order_by = "id";
 }
示例#14
0
 /**
  * Constructor
  *
  * @access	public
  * @return	void
  */
 public function __construct()
 {
     $CI =& get_instance();
     $CI->config->module_load(FUEL_FOLDER, 'fuel', TRUE);
     $tables = $CI->config->item('tables', 'fuel');
     parent::__construct($tables['fuel_archives']);
 }
 protected function callback_after_get($result)
 {
     $this->load->model('Blog_tag_model', 'tags');
     $result = parent::callback_after_get($result);
     $result->tags = $this->tags->get_by_post_id($result->id);
     return $result;
 }
 public function get($id_or_fields = null, $first_only = false, $order_by = null, $select_fields = array())
 {
     $tasks = parent::get($id_or_fields, $first_only, $order_by, $select_fields);
     if ($first_only || !is_array($tasks)) {
         $tasks = array($tasks);
     }
     if (!empty($tasks)) {
         foreach ($tasks as $key => $task) {
             if (empty($task)) {
                 continue;
             }
             $diagnostic_issue = $this->diagnostic_issue_model->get_from_cache($task->diagnostic_issue_id);
             $tasks[$key]->name = $this->step_model->get_name($task->step_id) . ': ' . $this->part_type_model->get_name($diagnostic_issue->part_type_id);
             $step_past = $this->step_model->get_past_tense($task->step_id);
             $issue = $this->issue_type_model->get_name($diagnostic_issue->issue_type_id);
             if (strstr($step_past, '[[part]]')) {
                 $step_past = str_replace('[[part]]', $this->part_type_model->get_name($diagnostic_issue->part_type_id), $step_past);
                 $tasks[$key]->past_name = $step_past;
             } else {
                 $tasks[$key]->past_name = $step_past . ' ' . $this->part_type_model->get_name($diagnostic_issue->part_type_id);
             }
             $tasks[$key]->past_name = strtolower($tasks[$key]->past_name);
             $tasks[$key]->issue_description = $issue . ' ' . $this->part_type_model->get_name($diagnostic_issue->part_type_id);
         }
     }
     if ($first_only || !is_array($id_or_fields)) {
         return reset($tasks);
     }
     return $tasks;
 }
示例#17
0
 public function __construct()
 {
     parent::__construct();
     $this->table_name = 'carriers';
     $this->nameCol = 'network';
     $this->set_dropdown_arrays();
 }
示例#18
0
 /**
  * Override parent
  */
 public function get_by($where, $joins = array())
 {
     $this->set_table_alias('u');
     $this->db->select('u.id, u.email, u.password, u.first_name, u.last_name, u.active, ug.name AS group');
     $joins[] = array('user_groups AS ug', 'u.group_id = ug.id');
     return parent::get_by($where, $joins);
 }
示例#19
0
 function validate_recover()
 {
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
     $this->form_validation->set_rules('username', $this->lang->line('username'), 'required');
     return parent::validate();
 }
示例#20
0
 public function __construct()
 {
     parent::__construct();
     $this->_table = 'choices';
     $this->primary_key = 'id';
     $this->site_lang = Settings::get('site_lang');
 }
示例#21
0
 public function create($data)
 {
     $options = array('cost' => 11);
     $data['password'] = password_hash($data['password'], PASSWORD_BCRYPT, $options);
     parent::create($data);
     return $this->db->insert_id();
 }
示例#22
0
文件: instr.php 项目: stevenygd/ling
 public function __construct()
 {
     parent::__construct();
     $this->tableName = "instructions";
     $this->enable_formatizing = TRUE;
     $this->json_fields = array("appendix");
 }
示例#23
0
 public function __construct()
 {
     parent::MY_Model();
     $this->tabla['nombre'] = 'campos';
     $this->tabla['campoclave'] = 'idcampo';
     $this->tabla['campos'] = array('idcampo', 'nombre');
 }
 function loadArray($where = array(), $except_value = '', $except_by = 'id')
 {
     $row = parent::loadArray($where, $except_value, $except_by);
     $eSessionActivity = new eSessionActivity();
     $eSessionActivity->parseRow($row);
     return $eSessionActivity;
 }
 function __construct()
 {
     parent::__construct();
     //
     //         $admin_userdata = $this->session->userdata(APP_PFIX . 'admin');
     //         var_dump($admin_userdata);die;
 }
示例#26
0
 function db_install()
 {
     $return = array();
     $this->load->database();
     $this->db->db_debug = 0;
     if ($this->db_install_tables()) {
         $return[] = $this->lang->line('install_database_success');
     } else {
         $return[] = $this->lang->line('install_database_problem');
         return $return;
     }
     $db_array = parent::db_array();
     $db_array['password'] = md5($db_array['password']);
     $db_array['global_admin'] = 1;
     unset($db_array['passwordv']);
     if (parent::save($db_array, NULL, FALSE)) {
         $return[] = $this->lang->line('install_admin_account_success');
     } else {
         $return[] = $this->lang->line('install_admin_account_problem');
         return $return;
     }
     $return[] = $this->lang->line('installation_complete');
     $return[] = $this->lang->line('install_delete_folder');
     $return[] = APPPATH . 'modules_core/setup';
     $return[] = anchor('sessions/login', $this->lang->line('log_in'));
     $this->mdl_mcb_modules->refresh();
     return $return;
 }
 public function __construct()
 {
     parent::__construct();
     $this->banco = $this->config->item('dbFabricaPinheiro');
     $this->tabela = $this->config->item('tblBannersTipos');
     $this->apelido = 'bnt';
 }
示例#28
0
 public function __construct()
 {
     parent::MY_Model();
     $this->tabla['nombre'] = 'seisenas';
     $this->tabla['campoclave'] = 'idseisena';
     $this->tabla['campos'] = array('idseisena', 'idmanada', 'idcampo', 'provincia', 'elementos');
 }
示例#29
0
 function check($from_node_id, $timestamp, $token, $to_node_id)
 {
     $rs = parent::findByAttributes(array('node_id' => $from_node_id));
     if ($rs) {
         $md5_key = md5($rs['certi_name'] . $rs['certi_key'] . $timestamp);
         if ($token == $md5_key) {
             $to_rs = parent::findByAttributes(array('node_id' => $to_node_id));
             $to_rs['library_type'] = '';
             if ($rs['certi_type'] == 'erp' && $to_rs['certi_type'] == 'ecstore') {
                 $to_rs['library_type'] = 'shopex';
             } else {
                 if ($rs['certi_type'] == 'ecstore' && $to_rs['certi_type'] == 'erp') {
                     $to_rs['library_type'] = 'shopex';
                 } else {
                     if ($rs['certi_type'] == 'youzan' && $to_rs['certi_type'] == 'erp') {
                         $to_rs['library_type'] = 'youzan';
                     } else {
                         if ($rs['certi_type'] == 'erp' && $to_rs['certi_type'] == 'youzan') {
                             $to_rs['library_type'] = 'youzan';
                         }
                     }
                 }
             }
             return $to_rs;
         }
     }
     return false;
 }
示例#30
0
 function check_slug($slug, $id = NULL)
 {
     if ($id) {
         $this->db->where('id !=', $id);
     }
     return parent::count_by('slug', $slug) == 0;
 }