You are here

GridStackInterface.php in GridStack 8

Same filename and directory in other branches
  1. 8.2 src/Entity/GridStackInterface.php

File

src/Entity/GridStackInterface.php
View source
<?php

namespace Drupal\gridstack\Entity;

use Drupal\Core\Config\Entity\ConfigEntityInterface;

/**
 * Provides an interface defining GridStack entity.
 */
interface GridStackInterface extends ConfigEntityInterface {

  /**
   * Returns the GridStack options by group, or property.
   *
   * @param string $group
   *   The name of setting group: breakpoints, grids, settings.
   * @param string $property
   *   The name of specific property: resizable, draggable, etc.
   *
   * @return mixed|array|null
   *   Available options by $group, $property, all, or NULL.
   */
  public function getOptions($group = NULL, $property = NULL);

  /**
   * Returns the value of a gridstack option group.
   *
   * @param string $group
   *   The group name: settings, icon, use_framework, breakpoints.
   *
   * @return mixed
   *   The option value merged with defaults.
   */
  public function getOption($group);

  /**
   * Sets the value of a gridstack option.
   *
   * @param string $name
   *   The option name: settings, icon, use_framework, breakpoints.
   * @param string $value
   *   The option value.
   *
   * @return $this
   *   The class is being called.
   */
  public function setOption($name, $value);

  /**
   * Returns the values of gridstack settings.
   *
   * @param bool $merged
   *   The flag indicating to merge values with default ones.
   *
   * @return mixed
   *   The settings values.
   */
  public function getSettings($merged = TRUE);

  /**
   * Sets the values of gridstack settings.
   *
   * @param array $values
   *   The setting values.
   * @param bool $merged
   *   The flag indicating to merge values with default ones.
   *
   * @return $this
   *   The class is being called.
   */
  public function setSettings(array $values, $merged = TRUE);

  /**
   * Returns the value of a gridstack setting.
   *
   * @param string $name
   *   The setting name.
   *
   * @return mixed
   *   The option value.
   */
  public function getSetting($name);

  /**
   * Sets the value of a gridstack setting.
   *
   * @param string $name
   *   The setting name.
   * @param string $value
   *   The setting value.
   *
   * @return $this
   *   The class is being called.
   */
  public function setSetting($name, $value);

  /**
   * Returns the GridStack json suitable for HTML data-attribute.
   *
   * @param string $group
   *   The option group can be settings or grids.
   *
   * @return string
   *   The output of the GridStack json.
   */
  public function getJson($group = 'settings');

}

Interfaces

Namesort descending Description
GridStackInterface Provides an interface defining GridStack entity.