Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   1  <?php
   2  
   3  namespace Box\Spout\Reader\ODS\Creator;
   4  
   5  use Box\Spout\Reader\ODS\Helper\CellValueFormatter;
   6  use Box\Spout\Reader\ODS\Helper\SettingsHelper;
   7  
   8  /**
   9   * Class HelperFactory
  10   * Factory to create helpers
  11   */
  12  class HelperFactory extends \Box\Spout\Common\Creator\HelperFactory
  13  {
  14      /**
  15       * @param bool $shouldFormatDates Whether date/time values should be returned as PHP objects or be formatted as strings
  16       * @return CellValueFormatter
  17       */
  18      public function createCellValueFormatter($shouldFormatDates)
  19      {
  20          $escaper = $this->createStringsEscaper();
  21  
  22          return new CellValueFormatter($shouldFormatDates, $escaper);
  23      }
  24  
  25      /**
  26       * @param InternalEntityFactory $entityFactory
  27       * @return SettingsHelper
  28       */
  29      public function createSettingsHelper($entityFactory)
  30      {
  31          return new SettingsHelper($entityFactory);
  32      }
  33  
  34      /**
  35       * @return \Box\Spout\Common\Helper\Escaper\ODS
  36       */
  37      public function createStringsEscaper()
  38      {
  39          /* @noinspection PhpUnnecessaryFullyQualifiedNameInspection */
  40          return new \Box\Spout\Common\Helper\Escaper\ODS();
  41      }
  42  }