本文整理汇总了PHP中MY_Model::update方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::update方法的具体用法?PHP MY_Model::update怎么用?PHP MY_Model::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Model
的用法示例。
在下文中一共展示了MY_Model::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_view_status
public function update_view_status($userID)
{
$query = parent::get_many_by('to', $userID);
$data = array('status' => 1);
foreach ($query as $msg) {
parent::update($msg->id, $data);
}
}
示例2: update
/**
* Update an existing category
* @access public
* @param int $id The ID of the category
* @param array $input The data to update
* @return bool
*/
public function update($id, $input)
{
return parent::update($id, array(
'title' => $input['title'],
'slug' => url_title(strtolower(convert_accented_characters($input['title'])))
));
}
示例3: update
/**
* Update
*
* @access public
* @param id $id
* @param array $input
* @return mixed
*/
public function update($id, $input = array())
{
return parent::update($id, array(
'name' => $input['name'],
'data' => $input['data']
));
}
示例4: update
public function update($primary_value, $data, $skip_validation = false)
{
$group = $data['group'];
unset($data['btnAction'], $data['group']);
if (parent::update($primary_value, $data)) {
return $this->_recipient_groups($primary_value, $group);
} else {
return FALSE;
}
}
示例5: update
function update($id, $input)
{
$this->load->helper('date');
return parent::update($id, array(
'title' => $input['title'],
'slug' => $input['slug'],
'description' => $input['description'],
'parent' => $input['parent'],
'updated_on' => now()
));
}
示例6: update
function update($data, $value = '')
{
if (is_array($data)) {
foreach ($data as $key => $value) {
$record = array('property' => $key, 'value' => $value);
parent::update($record);
}
} else {
$record = array('property' => $data, 'value' => $value);
parent::update($record);
}
}
示例7: update
/**
* Update resource details
*
* @access public
* @param int $resource_id
* @param array $attributes
* @return void
*/
function update($resource_id = 0, $attributes = array())
{
if ($resource_id > 0 && !$this->get_by_name($attributes['name'], $resource_id)) {
// Update
return parent::update($resource_id, $attributes);
} elseif (!$this->get_by_name($attributes['name'])) {
// Insert
return parent::insert($attributes);
} else {
return FALSE;
}
}
示例8: update
public function update($uid, $user)
{
$this->form_validation->set_rules('first_name', 'First Name', 'trim|required|xss_clean');
$this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|xss_clean');
$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[6]|xss_clean');
if ($this->form_validation->run()) {
if (parent::update($uid, $user)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
示例9: update
public function update($id=null, $data=array())
{
if (empty($data['pass_confirm']) && isset($data['password']))
{
unset($data['pass_confirm'], $data['password']);
}
else if (!empty($data['password']) && !empty($data['pass_confirm']) && $data['password'] == $data['pass_confirm'])
{
list($password, $salt) = $this->hash_password($data['password']);
unset($data['password'], $data['pass_confirm']);
}
if (isset($data['zipcode']))
{
$data['zipcode'] = (int)$data['zipcode'];
$data['zip_extra'] = (int)$data['zip_extra'];
}
return parent::update($id, $data);
}
示例10:
function update_reply_msg($data, $id = NULL)
{
parent::update($data, $id);
return $id;
}
示例11: activate
function activate($id)
{
return parent::update($id, array('is_active' => 1, 'activation_code' => ''));
}
示例12: update
/**
* Update a group
*
*
* @param int $id The ID of the role
* @param array $input The data to update
* @return array
*/
public function update($id = 0, $input = array(), $skip_validation = false)
{
return parent::update($id, array('description' => $input['description']));
}
示例13:
function update_lmember($data, $id = NULL)
{
parent::update($data, $id);
return $id;
}
示例14: update
public function update($data = array(), $id = 0)
{
parent::update($data, $id);
if ($this->db->affected_rows() > 0) {
return TRUE;
}
return FALSE;
}
示例15:
function update_expense($data, $id = NULL)
{
parent::update($data, $id);
return $id;
}