You are here

public function GridStack::getBreakpoints in GridStack 8

Same name and namespace in other branches
  1. 8.2 src/Entity/GridStack.php \Drupal\gridstack\Entity\GridStack::getBreakpoints()

Returns options.breakpoints.[xs|sm|md|lg|xl], or all, else empty.

If available, data may contain: column, image_style, width, grids, nested.

Parameters

string $breakpoint: The current breakpoint: xs, sm, md, lg, xl.

Return value

array Available data by the given $breakpoint parameter, else empty.

3 calls to GridStack::getBreakpoints()
GridStack::getBreakpointGrids in src/Entity/GridStack.php
Returns options.breakpoints.sm.[width, column, image_style, grids, nested].
GridStack::getEndBreakpointGrids in src/Entity/GridStack.php
Returns options.breakpoints.[lg|xl].[grids|nested].
GridStack::gridsJsonToArray in src/Entity/GridStack.php
Converts gridstack breakpoint grids from stored JSON into array.

File

src/Entity/GridStack.php, line 233

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getBreakpoints($breakpoint = NULL) {
  $breakpoints = $this
    ->getOption('breakpoints') ?: [];
  if ($breakpoint && isset($breakpoints[$breakpoint])) {
    return $breakpoints[$breakpoint];
  }
  return $breakpoints;
}