本文整理汇总了PHP中MY_Model类的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model类的具体用法?PHP MY_Model怎么用?PHP MY_Model使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MY_Model类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Model
/**
* @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: __construct
public function __construct()
{
parent::MY_Model();
$this->primary_key = "id";
$this->table_name = "solicitacao";
$this->order_by = "id";
}
示例3: rdf
/**
* 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;
}
示例4:
function __construct()
{
parent::__construct();
$this->table_nom = 'utilisateurs';
$this->cle_primaire = 'ID';
$this->table_order = '';
}
示例5: load
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;
}
示例6: lang
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']]];
}
示例7:
function __construct()
{
include BLOG_PATH . 'config/blog.php';
$tables = $config['tables'];
parent::__construct($tables['blog_settings']);
// table name
}
示例8: validate
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();
}
示例9: load
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;
}
示例10: __construct
public function __construct()
{
$this->table = 'user_details';
$this->primary_key = 'user_id';
$this->has_one['user'] = 'User_model';
parent::__construct();
}
示例11: check_name
/**
* 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;
}
示例12: load
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;
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->banco = $this->config->item('dbFabricaPinheiro');
$this->tabela = $this->config->item('tblBlogsCategorias');
$this->apelido = 'blc';
}
示例14: __construct
/**
* 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']);
}
示例15: callback_after_get
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;
}