Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

   1  <?php
   2  
   3  namespace Box\Spout\Writer\ODS\Manager;
   4  
   5  use Box\Spout\Common\Manager\OptionsManagerAbstract;
   6  use Box\Spout\Writer\Common\Creator\Style\StyleBuilder;
   7  use Box\Spout\Writer\Common\Entity\Options;
   8  
   9  /**
  10   * Class OptionsManager
  11   * ODS Writer options manager
  12   */
  13  class OptionsManager extends OptionsManagerAbstract
  14  {
  15      /** @var StyleBuilder Style builder */
  16      protected $styleBuilder;
  17  
  18      /**
  19       * OptionsManager constructor.
  20       * @param StyleBuilder $styleBuilder
  21       */
  22      public function __construct(StyleBuilder $styleBuilder)
  23      {
  24          $this->styleBuilder = $styleBuilder;
  25          parent::__construct();
  26      }
  27  
  28      /**
  29       * {@inheritdoc}
  30       */
  31      protected function getSupportedOptions()
  32      {
  33          return [
  34              Options::TEMP_FOLDER,
  35              Options::DEFAULT_ROW_STYLE,
  36              Options::SHOULD_CREATE_NEW_SHEETS_AUTOMATICALLY,
  37          ];
  38      }
  39  
  40      /**
  41       * {@inheritdoc}
  42       */
  43      protected function setDefaultOptions()
  44      {
  45          $this->setOption(Options::TEMP_FOLDER, \sys_get_temp_dir());
  46          $this->setOption(Options::DEFAULT_ROW_STYLE, $this->styleBuilder->build());
  47          $this->setOption(Options::SHOULD_CREATE_NEW_SHEETS_AUTOMATICALLY, true);
  48      }
  49  }