You are here

public function GridStack::getBreakpoints in GridStack 8.2

Same name and namespace in other branches
  1. 8 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.

Overrides GridStackInterface::getBreakpoints

3 calls to GridStack::getBreakpoints()
GridStack::breakpointsToArray in src/Entity/GridStack.php
Converts the entire breakpoint items from stored JSON into array.
GridStack::getBreakpointItems in src/Entity/GridStack.php
Returns options.breakpoints.sm.[width, column, grids, nested].
GridStack::getLastBreakpointKey in src/Entity/GridStack.php
Returns the last breakpoint key: Bootstrap3/Foundation lg, the rest xl.

File

src/Entity/GridStack.php, line 117

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;
}