本文整理匯總了PHP中Eloquent::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Eloquent::update方法的具體用法?PHP Eloquent::update怎麽用?PHP Eloquent::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Eloquent
的用法示例。
在下文中一共展示了Eloquent::update方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update_
public function update_(array $attributes = [])
{
$this->throwValidationException = true;
$callResult = parent::update($attributes);
$this->throwValidationException = false;
return $callResult;
}
示例2: update
/**
* When updating a post, run the attributes through a validator first.
* @param array $attributes
* @return void
*/
public function update(array $attributes = array(), array $options = array())
{
App::make('Components\\Posts\\Validation\\PostValidator')->validateForUpdate($attributes);
$extras = array();
$extras['contact_page'] = isset($attributes['contact']);
$extras['contact_coords'] = isset($attributes['contact_coords']) ? $attributes['contact_coords'] : '';
$attributes['extras'] = json_encode($extras);
$attributes['featured'] = isset($attributes['featured']) ? true : false;
$attributes['updated_by'] = current_user()->id;
return parent::update($attributes);
}
示例3: update
public function update(array $attributes = array())
{
$success = false;
$parent_id = $this->getAttribute('id');
$uid = (int) $this->getAttribute('uid');
// delete old items
EloquentTranslatedModel::items_delete(strtolower(get_called_class()), $parent_id, $uid);
$translated = filter_by_key_prefix($attributes, 'translated_', true);
$translated['uid'] = $uid;
$translated['module'] = strtolower(get_called_class());
$translated['parent_id'] = $parent_id;
// we create child translated
$success = EloquentTranslatedModel::create($translated);
return $success ? parent::update($attributes) : false;
}
示例4: update
/**
* When updating a post, run the attributes through a validator first.
* @param array $attributes
* @return void
*/
public function update(array $attributes = array(), array $options = array())
{
App::make('Components\\Posts\\Validation\\CategoryValidator')->validateForUpdate($attributes);
$attributes['updated_by'] = current_user()->id;
return parent::update($attributes);
}
示例5: update
/**
* When updating a theme, run the attributes through a validator first.
* @param array $attributes
* @return void
*/
public function update(array $attributes = array(), array $options = array())
{
$attributes['updated_by'] = current_user()->id;
return parent::update($attributes);
}
示例6: update
/**
* When updating a theme, run the attributes through a validator first.
* @param array $attributes
* @return void
*/
public function update(array $attributes = array())
{
// App::make('Components\\ThemeManager\\Validation\\ThemeValidator')->validateForUpdate($attributes);
$attributes['updated_by'] = current_user()->id;
return parent::update($attributes);
}
示例7: update
public function update(array $options = array())
{
$this->config = serialize($this->config);
return parent::update($options);
}