You are here

public function Bean::save in Bean (for Drupal 7) 7

Override the save to add clearing of caches

Overrides Entity::save

File

includes/bean.core.inc, line 360
Bean classes and plugin interface

Class

Bean
The Bean entity class

Code

public function save() {
  $this
    ->setUid()
    ->checkDelta();
  if (empty($this->created)) {
    $this->created = REQUEST_TIME;
  }
  $this->changed = REQUEST_TIME;
  $this->plugin
    ->submit($this);
  $return = parent::save();
  bean_reset(TRUE, TRUE);
  if (module_exists('block')) {
    bean_cache_clear_block($this);
  }
  return $return;
}