You are here

public function GridStack::getOptions in GridStack 8

Returns the GridStack options by group, or property.

Parameters

string $group: The name of setting group: breakpoints, grids, settings.

string $property: The name of specific property: resizable, draggable, etc.

Return value

mixed|array|null Available options by $group, $property, all, or NULL.

Overrides GridStackInterface::getOptions

1 call to GridStack::getOptions()
GridStack::getSetting in src/Entity/GridStack.php
Returns the value of a gridstack setting.

File

src/Entity/GridStack.php, line 103

Class

GridStack
Defines the GridStack configuration entity.

Namespace

Drupal\gridstack\Entity

Code

public function getOptions($group = NULL, $property = NULL) {
  $default = self::load('default');
  $options = $this->options ? array_merge($default->options, $this->options) : $default->options;
  if ($group) {
    if (is_array($group)) {
      return NestedArray::getValue($options, $group);
    }
    elseif (isset($property) && isset($options[$group])) {
      return isset($options[$group][$property]) ? $options[$group][$property] : NULL;
    }
    return isset($options[$group]) ? $options[$group] : $options;
  }
  return $options;
}