Overrides Drupal\Core\Entity\Entity::save().
Overrides Entity::save
public function save() {
// Check if everything is valid.
if (!$this
->isValid()) {
throw new InvalidBreakpointException('Invalid data detected.');
}
if (empty($this->id)) {
$this->id = $this->sourceType . '.' . $this->source . '.' . $this->name;
}
// Only save the keys, but return the full objects.
$this->breakpoints = array_keys($this->breakpoints);
parent::save();
$this
->loadAllBreakpoints();
}