本文整理汇总了PHP中MY_Model::save方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::save方法的具体用法?PHP MY_Model::save怎么用?PHP MY_Model::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Model
的用法示例。
在下文中一共展示了MY_Model::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save($id = NULL, $db_array = NULL)
{
$db_array = $db_array ? $db_array : $this->db_array();
$id = parent::save($id, $db_array);
$this->db->query('ALTER TABLE `' . $db_array['custom_field_table'] . '` ADD `' . $db_array['custom_field_column'] . '` VARCHAR( 255 ) NOT NULL');
return $id;
}
示例2: save
public function save($db_array, $user_id = NULL)
{
unset($db_array['passwordv']);
unset($db_array['client_id_autocomplete_label']);
$db_array['password'] = md5($db_array['password']);
parent::save($db_array, $user_id);
}
示例3: array
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;
}
示例4: find_or_create
public function find_or_create($tag)
{
$in = $this->where('tag', $tag)->find(NULL, 1);
if (empty($in)) {
$in['id'] = parent::save(array('tag' => $tag));
}
return $in['id'];
}
示例5: salvar
public function salvar($dados, $id)
{
$countLogin = $this->verificarDuplicidadeLogin($dados['login'], $id);
if ($countLogin > 0) {
return -2;
}
return parent::save($dados, $id);
}
示例6: save
public function save()
{
$db_array = $this->db_array();
if (!$this->input->post('provider_active')) {
$db_array['provider_active'] = 0;
}
parent::save($db_array, uri_assoc('provider_id', 4));
}
示例7: save
public function save($db_array, $user_id = NULL)
{
parent::save($db_array, $user_id);
if (!$user_id) {
$user_id = $this->db->insert_id();
}
return $user_id;
}
示例8: save
public function save($db_array, $id = NULL, $initial_stock_quantity = NULL)
{
parent::save($db_array, $id);
if ($initial_stock_quantity) {
$inventory_id = $this->db->insert_id();
$this->mdl_inventory_stock->adjust($inventory_id, $initial_stock_quantity, 0, $this->lang->line('initial_stock_quantity'));
}
}
示例9: save
public function save()
{
$now_in_mysql_format = date('Y-m-d H:i:s');
$this->updated = $now_in_mysql_format;
if (!($this->id > 0)) {
$this->created = $now_in_mysql_format;
}
return parent::save();
}
示例10: save_custom
public function save_custom($invoice_id, $db_array)
{
$invoice_custom_id = null;
$db_array['invoice_id'] = $invoice_id;
$invoice_custom = $this->where('invoice_id', $invoice_id)->get();
if ($invoice_custom->num_rows()) {
$invoice_custom_id = $invoice_custom->row()->invoice_custom_id;
}
parent::save($invoice_custom_id, $db_array);
}
示例11: save_custom
public function save_custom($payment_id, $db_array)
{
$payment_custom_id = null;
$db_array['payment_id'] = $payment_id;
$payment_custom = $this->where('payment_id', $payment_id)->get();
if ($payment_custom->num_rows()) {
$payment_custom_id = $payment_custom->row()->payment_custom_id;
}
parent::save($payment_custom_id, $db_array);
}
示例12: save
function save($db_array, $invoice_group_id)
{
if (!isset($db_array['invoice_group_prefix_year'])) {
$db_array['invoice_group_prefix_year'] = 0;
}
if (!isset($db_array['invoice_group_prefix_month'])) {
$db_array['invoice_group_prefix_month'] = 0;
}
parent::save($db_array, $invoice_group_id);
}
示例13: save_custom
public function save_custom($user_id, $db_array)
{
$user_custom_id = NULL;
$db_array['user_id'] = $user_id;
$user_custom = $this->where('user_id', $user_id)->get();
if ($user_custom->num_rows()) {
$user_custom_id = $user_custom->row()->user_custom_id;
}
parent::save($user_custom_id, $db_array);
}
示例14: save_custom
public function save_custom($quote_id, $db_array)
{
$quote_custom_id = NULL;
$db_array['quote_id'] = $quote_id;
$quote_custom = $this->where('quote_id', $quote_id)->get();
if ($quote_custom->num_rows()) {
$quote_custom_id = $quote_custom->row()->quote_custom_id;
}
parent::save($quote_custom_id, $db_array);
}
示例15: save_custom
public function save_custom($client_id, $db_array)
{
$client_custom_id = NULL;
$db_array['client_id'] = $client_id;
$client_custom = $this->where('client_id', $client_id)->get();
if ($client_custom->num_rows()) {
$client_custom_id = $client_custom->row()->client_custom_id;
}
parent::save($client_custom_id, $db_array);
}