You are here

interface ExporterInterface in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/ExporterInterface.php \AKlump\LoftDataGrids\ExporterInterface

Interface ExporterInterface

Hierarchy

Expanded class hierarchy of ExporterInterface

All classes that implement ExporterInterface

1 string reference to 'ExporterInterface'
_loft_data_grids_get_exporter_names in ./loft_data_grids.module
Return an array of Exporter classnames dynamically loaded and cached

File

vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/ExporterInterface.php, line 8

Namespace

AKlump\LoftDataGrids
View source
interface ExporterInterface {

  /**
   * Set the exporter to display page ids.
   *
   * It's up to the class to respect this setting or not.
   *
   * @return $this
   */
  public function showPageIds();

  /**
   * Set the exporter to hide page ids.
   *
   * It's up to the class to respect this setting or not.
   *
   * @return $this
   */
  public function hidePageIds();

  /**
   * Return the showPageIds.
   *
   * @return bool
   */
  public function getShowPageIds();

  /**
   * Format a single column with format by string
   *
   * @param string $column
   * @param string $format_code
   * - USD
   *
   * @return $this
   */
  public function formatColumn($column, $format_code);

  /**
   * Set the export data object
   *
   * @param ExportDataInterface $data
   *
   * @return $this
   */
  public function setData(ExportDataInterface $data);

  /**
   * Set a title for the exported document
   *
   * @return $this
   */
  public function setTitle($title);
  public function getTitle();

  /**
   * Getter/Setter for the filename
   *
   * @param string $filename
   *   Extension (if present in $filename) will be corrected based on the
   *   object
   *
   * @return string
   *   The final $filename with correct extension
   */
  public function setFilename($filename);

  /**
   * Get the filename
   *
   * @return string
   */
  public function getFilename();

  /**
   * Build the string content of $this->output and return $this for chaining.
   *
   * @param mixed $page_id
   *   (Optional) Defaults to NULL.  Set this to only compile a single page.
   *
   * @return $this
   */
  public function compile($page_id = null);

  /**
   * Export data as a string
   *
   * @param mixed $page_id
   *   (Optional) Defaults to NULL.  Set this to export a single page.
   *
   * @return string
   */
  public function export($page_id = null);

  /**
   * Compile and and save to a filepath.
   *
   * @param string $directory A writable directory in which to save the file.
   * @param null   $filename
   * @param null   $page_id
   *
   * @return mixed
   */
  public function saveFile($directory, $filename = null, $page_id = null);

  /**
   * Stream as a file to the server with headers.
   *
   * @param string $filename
   *   The correct extension will be appended to this string
   * @param mixed  $page_id
   *   (Optional) Defaults to NULL.  Set this to export a single page.
   */
  public function save($filename = '', $page_id = null);

  /**
   * Return the ExportDataInterface object
   *
   * @return ExportDataInterface
   */
  public function getData();

  /**
   * Return an array each of the keys present in the data on a page.
   *
   * @param mixed $page_id
   *   (Optional) Defaults to 0.
   *
   * @return array
   *   - The keys of the header MUST match the keys of each row of data.
   *   - The values can be human titles for the keys.
   */
  public function getHeader($page_id = 0);

  /**
   * Return info about this class
   *
   * @return array
   *   - name string The human name of this exporter
   *   - shortname string A more concise human name for ui elements like
   *   option lists
   *   - description string A further description
   *   - extension string The file extension used by this class
   */
  public function getInfo();

  /**
   * Set the settings object.
   *
   * @param object|array $settings
   *   If an array, the keys will be used as the property name, and the
   *   values as values.
   *
   * @return $this
   */
  public function setSettings($settings);

  /**
   * Adds/Updates a single setting by name.
   *
   * You can also use $this->getSettings()->{name} = {value}.
   *
   * @param string $name
   * @param mixed  $value
   *
   * @return $this
   */
  public function addSetting($name, $value);

  /**
   * Return the settings object.
   *
   * To set use $this->addSetting() or:
   * $this->getSettings()->{name} = {value}
   *
   * To get a single setting you will do this:
   * $this->getSettings()->sponsors
   *
   * @return array
   *
   * @see addSetting($name, $value)
   */
  public function getSettings();

}

Members

Namesort descending Modifiers Type Description Overrides
ExporterInterface::addSetting public function Adds/Updates a single setting by name. 1
ExporterInterface::compile public function Build the string content of $this->output and return $this for chaining. 12
ExporterInterface::export public function Export data as a string 1
ExporterInterface::formatColumn public function Format a single column with format by string 1
ExporterInterface::getData public function Return the ExportDataInterface object 1
ExporterInterface::getFilename public function Get the filename 1
ExporterInterface::getHeader public function Return an array each of the keys present in the data on a page. 1
ExporterInterface::getInfo public function Return info about this class 1
ExporterInterface::getSettings public function Return the settings object. 1
ExporterInterface::getShowPageIds public function Return the showPageIds. 1
ExporterInterface::getTitle public function 1
ExporterInterface::hidePageIds public function Set the exporter to hide page ids. 1
ExporterInterface::save public function Stream as a file to the server with headers. 1
ExporterInterface::saveFile public function Compile and and save to a filepath. 1
ExporterInterface::setData public function Set the export data object 1
ExporterInterface::setFilename public function Getter/Setter for the filename 1
ExporterInterface::setSettings public function Set the settings object. 1
ExporterInterface::setTitle public function Set a title for the exported document 1
ExporterInterface::showPageIds public function Set the exporter to display page ids. 1