예제 #1
0
 public function update_(array $attributes = [])
 {
     $this->throwValidationException = true;
     $callResult = parent::update($attributes);
     $this->throwValidationException = false;
     return $callResult;
 }
예제 #2
0
파일: Post.php 프로젝트: doptor/doptor
 /**
  * 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);
 }
 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
0
파일: Category.php 프로젝트: doptor/doptor
 /**
  * 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
0
 /**
  * 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
0
파일: Theme.php 프로젝트: jrafaelca/Doptor
 /**
  * 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
0
 public function update(array $options = array())
 {
     $this->config = serialize($this->config);
     return parent::update($options);
 }