You are here

FileHandleTraitWebformExporter.php in Webform 6.x

Same filename and directory in other branches
  1. 8.5 src/Plugin/WebformExporter/FileHandleTraitWebformExporter.php

File

src/Plugin/WebformExporter/FileHandleTraitWebformExporter.php
View source
<?php

namespace Drupal\webform\Plugin\WebformExporter;


/**
 * Defines file handle exporter trait.
 */
trait FileHandleTraitWebformExporter {

  /**
   * A file handler resource.
   *
   * @var resource
   */
  protected $fileHandle;

  /**
   * {@inheritdoc}
   */
  public function createExport() {
    $this->fileHandle = fopen($this
      ->getExportFilePath(), 'w');
  }

  /**
   * {@inheritdoc}
   */
  public function openExport() {
    $this->fileHandle = fopen($this
      ->getExportFilePath(), 'a');
  }

  /**
   * {@inheritdoc}
   */
  public function closeExport() {
    fclose($this->fileHandle);
  }

}

Traits

Namesort descending Description
FileHandleTraitWebformExporter Defines file handle exporter trait.