Esempio n. 1
0
 public function update_(array $attributes = [])
 {
     $this->throwValidationException = true;
     $callResult = parent::update($attributes);
     $this->throwValidationException = false;
     return $callResult;
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 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);
 }
Esempio n. 6
0
 /**
  * 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);
 }
 public function update(array $options = array())
 {
     $this->config = serialize($this->config);
     return parent::update($options);
 }