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.
   1  <?php
   2  
   3  namespace Box\Spout\Reader\ODS;
   4  
   5  use Box\Spout\Reader\SheetInterface;
   6  
   7  /**
   8   * Class Sheet
   9   * Represents a sheet within a ODS file
  10   */
  11  class Sheet implements SheetInterface
  12  {
  13      /** @var \Box\Spout\Reader\ODS\RowIterator To iterate over sheet's rows */
  14      protected $rowIterator;
  15  
  16      /** @var int ID of the sheet */
  17      protected $id;
  18  
  19      /** @var int Index of the sheet, based on order in the workbook (zero-based) */
  20      protected $index;
  21  
  22      /** @var string Name of the sheet */
  23      protected $name;
  24  
  25      /** @var bool Whether the sheet was the active one */
  26      protected $isActive;
  27  
  28      /** @var bool Whether the sheet is visible */
  29      protected $isVisible;
  30  
  31      /**
  32       * @param RowIterator $rowIterator The corresponding row iterator
  33       * @param int $sheetIndex Index of the sheet, based on order in the workbook (zero-based)
  34       * @param string $sheetName Name of the sheet
  35       * @param bool $isSheetActive Whether the sheet was defined as active
  36       * @param bool $isSheetVisible Whether the sheet is visible
  37       */
  38      public function __construct($rowIterator, $sheetIndex, $sheetName, $isSheetActive, $isSheetVisible)
  39      {
  40          $this->rowIterator = $rowIterator;
  41          $this->index = $sheetIndex;
  42          $this->name = $sheetName;
  43          $this->isActive = $isSheetActive;
  44          $this->isVisible = $isSheetVisible;
  45      }
  46  
  47      /**
  48       * @return \Box\Spout\Reader\ODS\RowIterator
  49       */
  50      public function getRowIterator()
  51      {
  52          return $this->rowIterator;
  53      }
  54  
  55      /**
  56       * @return int Index of the sheet, based on order in the workbook (zero-based)
  57       */
  58      public function getIndex()
  59      {
  60          return $this->index;
  61      }
  62  
  63      /**
  64       * @return string Name of the sheet
  65       */
  66      public function getName()
  67      {
  68          return $this->name;
  69      }
  70  
  71      /**
  72       * @return bool Whether the sheet was defined as active
  73       */
  74      public function isActive()
  75      {
  76          return $this->isActive;
  77      }
  78  
  79      /**
  80       * @return bool Whether the sheet is visible
  81       */
  82      public function isVisible()
  83      {
  84          return $this->isVisible;
  85      }
  86  }