You are here

public function BreakpointGroup::save in Breakpoints 8

Overrides Drupal\Core\Entity::save().

Overrides ConfigEntityBase::save

2 calls to BreakpointGroup::save()
BreakpointGroup::override in lib/Drupal/breakpoint/BreakpointGroup.php
Override a breakpoint group.
BreakpointGroup::revert in lib/Drupal/breakpoint/BreakpointGroup.php
Revert a breakpoint group after it has been overridden.

File

lib/Drupal/breakpoint/BreakpointGroup.php, line 88
Definition of Drupal\breakpoint\BreakpointGroup.

Class

BreakpointGroup
Defines the BreakpointGroup entity.

Namespace

Drupal\breakpoint

Code

public function save() {

  // Check if everything is valid.
  if (!$this
    ->isValid()) {
    throw new Exception('Invalid data detected.');
  }

  // Only save the keys, but return the full objects.
  $this->breakpoints = array_keys($this->breakpoints);
  parent::save();
  $this
    ->loadAllBreakpoints();
}