Exporter Class Reference

Inheritance diagram for Exporter:
ExporterInterface CSVExporter JSONExporter MarkdownExporter TextListExporter XLSXExporter XMLExporter YAMLExporter FlatTextExporter HTMLExporter TabTextExporter

Public Member Functions

 __construct (ExportDataInterface $data, $filename= '')
 getInfo ()
 setFilename ($filename)
 setTitle ($title)
 getTitle ()
 getFilename ()
 getData ()
 getHeader ($page_id=0)
 setData (ExportDataInterface $data)
 formatColumn ($column, $format_code)
 compile ($page_id=NULL)
 export ($page_id=NULL)
 save ($filename= '', $page_id=NULL)

Data Fields

 $dependencies = TRUE

Protected Member Functions

 filenameSafe ($string, $options=array())

Protected Attributes

 $export_data
 $title
 $filename
 $extension
 $output
 $header = array()

Detailed Description

Class Exporter


Constructor & Destructor Documentation

__construct ( ExportDataInterface data,
filename = '' 
)

Constructor

Parameters:
ExportDataInterface $data
string $filename (Optional) Defaults to ''.

Reimplemented in CSVExporter, FlatTextExporter, TabTextExporter, and YAMLExporter.


Member Function Documentation

compile ( page_id = NULL  )  [abstract]

Build $this->output in prep for export/save

This is the main method to be extended for the different exporters

Reimplemented in CSVExporter, FlatTextExporter, HTMLExporter, JSONExporter, MarkdownExporter, TextListExporter, XLSXExporter, XMLExporter, and YAMLExporter.

export ( page_id = NULL  ) 

Export data as a string

Parameters:
mixed $page_id (Optional) Defaults to NULL. Set this to export a single page.
Returns:
string

Implements ExporterInterface.

Reimplemented in XLSXExporter.

filenameSafe ( string,
options = array() 
) [protected]

Return a string as a safe filename

Parameters:
string $string The candidtate filename.
array $options

  • array extensions: allowable extensions no periods
  • string ext: default extension if non found; blank for none no period
Returns:
string
  • lowercased, with only letters, numbers, dots and hyphens
See also:
file_munge_filename().
formatColumn ( column,
format_code 
)

Format a single column with format by string

Parameters:
string $column
string $format_code

  • USD
Returns:
$this

Implements ExporterInterface.

Reimplemented in XLSXExporter.

getData (  ) 

Return the ExportDataInterface object

Returns:
ExportDataInterface

Implements ExporterInterface.

getFilename (  ) 

Get the filename

Returns:
string

Implements ExporterInterface.

getHeader ( page_id = 0  ) 

Return an array containing the header row values for a page

Parameters:
mixed $page_id (Optional) Defaults to 0.
Returns:
array
  • The keys of the header MUST match the keys of each row of data

Implements ExporterInterface.

getInfo (  ) 

Return info about this class

Parameters:
type $string description
Returns:
array
  • name string The human name of this exporter
  • descripttion string A further description
  • extension string The file extension used by this class

Implements ExporterInterface.

Reimplemented in CSVExporter, FlatTextExporter, JSONExporter, MarkdownExporter, TabTextExporter, TextListExporter, XLSXExporter, XMLExporter, and YAMLExporter.

getTitle (  ) 

Implements ExporterInterface.

save ( filename = '',
page_id = NULL 
)

Save as a file to the server

Parameters:
string $filename The correct extension will be appended to this string
mixed $page_id (Optional) Defaults to NULL. Set this to export a single page.

Implements ExporterInterface.

Reimplemented in XLSXExporter.

setData ( ExportDataInterface data  ) 

Set the export data object

Parameters:
ExportDataInterface $data
Returns:
$this

Implements ExporterInterface.

setFilename ( filename  ) 

Getter/Setter for the filename

Parameters:
string $filename Extension (if present in $filename) will be corrected based on the object
Returns:
string The final $filename with correct extension

Implements ExporterInterface.

setTitle ( title  ) 

Set a title for the exported document

Returns:
$this

Implements ExporterInterface.

Reimplemented in XLSXExporter.


Field Documentation

$dependencies = TRUE

You may check this public variable to see if any dependencies for this class are missing. If this is false it means a dependency is missing and the exporter cannot function properly. The way to do this is to instantiate the class and then immediately check this variable, before calling any other methods.

$export_data [protected]
$extension [protected]
$filename [protected]
$header = array() [protected]
$output [protected]
$title [protected]

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables

Generated on Fri Jan 17 20:40:34 2014 for Loft Data Grids by  doxygen 1.6.1