classes/phing/tasks/ext/pdo/PDOSQLExecFormatterElement.php

\PDOSQLExecFormatterElement

A class to represent the nested <formatter> element for PDO SQL results.

This class is inspired by the similarly-named class in the PHPUnit tasks.

author
Hans Lellelid
package
phing.tasks.ext.pdo
since
2.3.0

Properties

Propertyprivateboolean  $append= 'false'

Append to an existing file or overwrite it?

Default valuefalseDetails
Type
boolean
Propertyprivatestring  $coldelimiter= ','

Column delimiter.

Defaults to ','

Default value,Details
Type
string
Propertyprivatestring  $encoding= ''

Encoding for XML output.

Details
Type
string
Propertyprivateboolean  $formatoutput= 'true'

Whether to format XML output.

Default valuetrueDetails
Type
boolean
Propertyprivate\PDOResultFormatter  $formatter= ''

Details
Type
\PDOResultFormatter
Propertyprivatearray  $formatterParams= 'array'

Parameters for a custom formatter.

Parameter[]
Default valuearrayDetails
Type
array
Propertyprivate\PhingFile  $outfile= ''

Output file for formatter.

Details
Type
\PhingFile
Propertyprivate\PDOSQLExecTask  $parentTask= ''

Details
Type
\PDOSQLExecTask
Propertyprivatestring  $rowdelimiter= 'PHP_EOL'

Row delimiter.

Defaults to PHP_EOL.

Default valuePHP_EOLDetails
Type
string
Propertyprivateboolean  $showheaders= 'true'

Print header columns.

Default valuetrueDetails
Type
boolean
Propertyprivatestring  $type= ''

The type of the formatter (used for built-in formatter classes).

Details
Type
string
Propertyprivateboolean  $useFile= 'true'

Whether to use file (or write output to phing log).

Default valuetrueDetails
Type
boolean

Methods

methodpublic  __construct( \PDOSQLExecTask $parentTask ) :
Construct a new PDOSQLExecFormatterElement with parent task.
Parameters
Name Type Description
$parentTask \PDOSQLExecTask
methodpublic  createParam( ) : \Parameter
Supports nested element (for custom formatter classes).
Returns
Type Description
\Parameter
methodpublic  getAppend( ) : boolean
Whether output should be appended to file.
Returns
Type Description
boolean
methodprivate  getDefaultOutput( ) : \Writer
Gets a default output writer for this task.
Returns
Type Description
\Writer
methodpublic  getFormatter( ) : \PDOResultFormatter
Gets the formatter that has been configured based on this element.
Returns
Type Description
\PDOResultFormatter
methodpublic  getOutfile( ) : \PhingFile
Get the output file.
Returns
Type Description
\PhingFile
methodprivate  getOutputWriter( ) : \Writer
Gets a configured output writer.
Returns
Type Description
\Writer
methodpublic  getUseFile( ) : boolean
Return whether to write formatter results to file.
Returns
Type Description
boolean
methodpublic  prepare( ) :
Configures wrapped formatter class with any attributes on this element.
methodpublic  setAppend( boolean $append ) :
whether output should be appended to or overwrite an existing file. Defaults to false.
Parameters
Name Type Description
$append boolean
methodpublic  setClassName( string $className ) :
Set classname for a custom formatter (must extend PDOResultFormatter).
Parameters
Name Type Description
$className string
methodpublic  setColdelim( string $v ) :
Sets the column delimiter.
Parameters
Name Type Description
$v string
methodpublic  setEncoding( string $v ) :
Set the DOM document encoding.
Parameters
Name Type Description
$v string
methodpublic  setFormatOutput( boolean $v ) :
Parameters
Name Type Description
$v boolean
methodpublic  setOutfile(  $outfile ) :
Sets the output file for the formatter results.
Parameters
Name Type Description
$outfile
methodpublic  setRowdelim( string $v ) :
Sets the row delimiter.
Parameters
Name Type Description
$v string
methodpublic  setShowheaders( boolean $showheaders ) :
Print headers for result sets from the statements; optional, default true.
Parameters
Name Type Description
$showheaders boolean
methodpublic  setType( string $type ) :
Sets the formatter type.
Parameters
Name Type Description
$type string
methodpublic  setUseFile( boolean $useFile ) :
Set whether to write formatter results to file.
Parameters
Name Type Description
$useFile boolean
Documentation was generated by DocBlox 0.13.1.