Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

   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  }