public function boxes_box::save

cis7 boxes_box.inc public boxes_box::save()
cle7 boxes_box.inc public boxes_box::save()
elmsmedia7 boxes_box.inc public boxes_box::save()
icor7 boxes_box.inc public boxes_box::save()
meedjum_blog7 boxes_box.inc public boxes_box::save()
mooc7 boxes_box.inc public boxes_box::save()

Save a box.

File

sites/all/modules/ulmus/boxes/plugins/boxes_box.inc, line 94

Class

boxes_box
Abstract base class defining a box. A boxes content plugin provides a form of options for configuring content and renders content for display.

Code

public function save() {
  if (empty($this->delta)) {
    throw new Exception(t('Cannot save box without a specified delta.'));
  }
  self::reset();
  $existing = boxes_box_load($this->delta);
  if ($existing && ($existing->export_type & EXPORT_IN_DATABASE)) {
    drupal_write_record('box', $this, array('delta'));
  }
  else {
    drupal_write_record('box', $this);
  }
  $this->new = FALSE;
  self::reset();
  module_exists('context') ? context_invalidate_cache() : NULL;
}