You are here

public function Breakpoint::revert in Breakpoints 8

Revert a breakpoint and save it.

Return value

Drupal\breakpoint\Breakpoint|false

File

lib/Drupal/breakpoint/Breakpoint.php, line 193
Definition of Drupal\breakpoint\Breakpoint.

Class

Breakpoint
Defines the Breakpoint entity.

Namespace

Drupal\breakpoint

Code

public function revert() {
  if (!$this->overridden || $this->sourceType === Breakpoint::SOURCE_TYPE_CUSTOM) {
    return FALSE;
  }
  $this->overridden = FALSE;
  $this->mediaQuery = $this->originalMediaQuery;
  $this
    ->save();
  return $this;
}