You are here

public function Breakpoint::override in Breakpoints 8

Override a breakpoint and save it.

Return value

Drupal\breakpoint\Breakpoint|false

File

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

Class

Breakpoint
Defines the Breakpoint entity.

Namespace

Drupal\breakpoint

Code

public function override() {

  // Custom breakpoint can't be overridden.
  if ($this->overridden || $this->sourceType === Breakpoint::SOURCE_TYPE_CUSTOM) {
    return FALSE;
  }

  // Mark breakpoint as overridden.
  $this->overridden = TRUE;
  $this->originalMediaQuery = $this->mediaQuery;
  $this
    ->save();
  return $this;
}