You are here

class ExportingOptions in Charts 8.3

Class ExportingOptions.

Hierarchy

  • class \Drupal\charts_highcharts\Settings\Highcharts\ExportingOptions implements \Drupal\charts_highcharts\Settings\Highcharts\JsonSerializable

Expanded class hierarchy of ExportingOptions

1 file declares its use of ExportingOptions
Highcharts.php in modules/charts_highcharts/src/Plugin/chart/Highcharts.php

File

modules/charts_highcharts/src/Settings/Highcharts/ExportingOptions.php, line 8

Namespace

Drupal\charts_highcharts\Settings\Highcharts
View source
class ExportingOptions implements \JsonSerializable {

  /**
   * Is exporting enabled.
   *
   * @var bool
   */
  private $enabled = TRUE;

  /**
   * ExportingOptions constructor.
   *
   * @param array $array
   *   (optional) A keyed array defining the exporting settings.
   */
  public function __construct(array $array = []) {
    foreach ($array as $key => $value) {
      switch ($key) {
        case 'enabled':
          $this
            ->setEnabled($value);
          break;
      }
    }
  }

  /**
   * Get enabled.
   *
   * @return bool
   *   Whether exporting is enabled.
   */
  public function getEnabled() {
    return $this->enabled;
  }

  /**
   * Set enabled.
   *
   * @param bool $enabled
   *   Enabled if TRUE, disabled otherwise.
   */
  public function setEnabled($enabled) {
    $this->enabled = $enabled;
  }

  /**
   * Json Serialize.
   *
   * @return array
   *   Json Serialize.
   */
  public function jsonSerialize() {
    $vars = get_object_vars($this);
    return $vars;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExportingOptions::$enabled private property Is exporting enabled.
ExportingOptions::getEnabled public function Get enabled.
ExportingOptions::jsonSerialize public function Json Serialize.
ExportingOptions::setEnabled public function Set enabled.
ExportingOptions::__construct public function ExportingOptions constructor.