You are here

class Xlsx in Excel Serialization 8

Adds XLSX encoder support for the Serialization API.

Hierarchy

  • class \Drupal\xls_serialization\Encoder\Xls implements \Symfony\Component\Serializer\Encoder\EncoderInterface
    • class \Drupal\xls_serialization\Encoder\Xlsx

Expanded class hierarchy of Xlsx

3 string references to 'Xlsx'
Xls::setSettings in src/Encoder/Xls.php
Set XLS settings from the Views settings array.
Xls::__construct in src/Encoder/Xls.php
Constructs an XLS encoder.
xls_serialization.services.yml in ./xls_serialization.services.yml
xls_serialization.services.yml
1 service uses Xlsx
xls_serialization.encoder.xlsx in ./xls_serialization.services.yml
Drupal\xls_serialization\Encoder\Xlsx

File

src/Encoder/Xlsx.php, line 8

Namespace

Drupal\xls_serialization\Encoder
View source
class Xlsx extends Xls {

  /**
   * The format that this encoder supports.
   *
   * @var string
   */
  protected static $format = 'xlsx';

  /**
   * Format to write XLS files as.
   *
   * @var string
   */
  protected $xlsFormat = 'Xlsx';

  /**
   * Constructs an XLS encoder.
   *
   * @param string $xls_format
   *   The XLS format to use.
   */
  public function __construct($xls_format = 'Xlsx') {
    $this->xlsFormat = $xls_format;
  }

  /**
   * {@inheritdoc}
   */
  protected function setSettings(array $settings) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Xls::encode public function Encodes data into the given format.
Xls::extractHeaders protected function Extract the headers from the data array.
Xls::formatValue protected function Formats a single value for a given XLS cell.
Xls::getColumnLetterFromFieldName protected function Get the column letter for a field name from the headers.
Xls::getOperatorFromSelectIndex protected function Returns the operator for conditional formatting from the HTML-select index.
Xls::getViewFieldLabel protected function Get the label in the view for a field name (if available)
Xls::setColumnsAutoSize protected function Set width of all columns with data in them in sheet to AutoSize.
Xls::setConditionalFormat protected function Gets conditional formatting for whole row if the comparison is TRUE.
Xls::setConditionalFormating protected function Sets conditional formats on worksheet.
Xls::setData protected function Set sheet data.
Xls::setHeaderRowBackgroundColor protected function Set background color of the header (first) row.
Xls::setHeaderRowBold protected function Set font of the header (first) row to bold.
Xls::setHeaderRowItalic protected function Set font of the header (first) row to italic.
Xls::setHeaders protected function Set sheet headers.
Xls::setMetaData protected function Set any available metadata.
Xls::supportsEncoding public function Checks whether the serializer can encode to given format.
Xls::validateWorksheetTitle protected function Validates the title of the Worksheet to ensure it's valid.
Xlsx::$format protected static property The format that this encoder supports. Overrides Xls::$format
Xlsx::$xlsFormat protected property Format to write XLS files as. Overrides Xls::$xlsFormat
Xlsx::setSettings protected function Set XLS settings from the Views settings array. Overrides Xls::setSettings
Xlsx::__construct public function Constructs an XLS encoder. Overrides Xls::__construct