本文整理汇总了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);
}