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

## \PDOSQLExecFormatterElement
jump to top

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

`boolean $append= 'false'`

Append to an existing file or overwrite it?

Default value `false` Details

Type
  boolean

`string $coldelimiter= ','`

Column delimiter.

Defaults to ','

Default value`,`Details

Type
  string

`string $encoding= ''`

Encoding for XML output.

Details

Type
  string

`boolean $formatoutput= 'true'`

Whether to format XML output.

Default value `true` Details

Type
  boolean

`\PDOResultFormatter $formatter= ''`

Details

Type
  \PDOResultFormatter

`array $formatterParams= 'array'`

Parameters for a custom formatter.

Parameter[]
Default value `array` Details

Type
  array

`\PhingFile $outfile= ''`

Output file for formatter.

Details

Type
  \PhingFile

`\PDOSQLExecTask $parentTask= ''`

Details

Type
  \PDOSQLExecTask

`string $rowdelimiter= 'PHP_EOL'`

Row delimiter.

Defaults to PHP_EOL.

Default value `PHP_EOL` Details

Type
  string

`boolean $showheaders= 'true'`

Print header columns.

Default value `true` Details

Type
  boolean

`string $type= ''`

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

Details

Type
  string

`boolean $useFile= 'true'`

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

Default value `true` Details

Type
  boolean

### Methods

`__construct( \PDOSQLExecTask $parentTask ) :`
Construct a new PDOSQLExecFormatterElement with parent task.
Parameters

Name | Type | Description
--- | --- | ---
$parentTask | \PDOSQLExecTask |

`createParam( ) : \Parameter`
Supports nested element (for custom formatter classes).
Returns

Type | Description
--- | ---
\Parameter |

`getAppend( ) : boolean`
Whether output should be appended to file.
Returns

Type | Description
--- | ---
boolean |

`getDefaultOutput( ) : \Writer`
Gets a default output writer for this task.
Returns

Type | Description
--- | ---
\Writer |

`getFormatter( ) : \PDOResultFormatter`
Gets the formatter that has been configured based on this element.
Returns

Type | Description
--- | ---
\PDOResultFormatter |

`getOutfile( ) : \PhingFile`
Get the output file.
Returns

Type | Description
--- | ---
\PhingFile |

`getOutputWriter( ) : \Writer`
Gets a configured output writer.
Returns

Type | Description
--- | ---
\Writer |

`getUseFile( ) : boolean`
Return whether to write formatter results to file.
Returns

Type | Description
--- | ---
boolean |

`prepare( ) :`
Configures wrapped formatter class with any attributes on this element.
`setAppend( boolean $append ) :`
whether output should be appended to or overwrite an existing file. Defaults to false.
Parameters

Name | Type | Description
--- | --- | ---
$append | boolean |

`setClassName( string $className ) :`
Set classname for a custom formatter (must extend PDOResultFormatter).
Parameters

Name | Type | Description
--- | --- | ---
$className | string |

`setColdelim( string $v ) :`
Sets the column delimiter.
Parameters

Name | Type | Description
--- | --- | ---
$v | string |

`setEncoding( string $v ) :`
Set the DOM document encoding.
Parameters

Name | Type | Description
--- | --- | ---
$v | string |

`setFormatOutput( boolean $v ) :`
Parameters

Name | Type | Description
--- | --- | ---
$v | boolean |

`setOutfile( $outfile ) :`
Sets the output file for the formatter results.
Parameters

Name | Type | Description
--- | --- | ---
$outfile |  |

`setRowdelim( string $v ) :`
Sets the row delimiter.
Parameters

Name | Type | Description
--- | --- | ---
$v | string |

`setShowheaders( boolean $showheaders ) :`
Print headers for result sets from the statements; optional, default true.
Parameters

Name | Type | Description
--- | --- | ---
$showheaders | boolean |

`setType( string $type ) :`
Sets the formatter type.
Parameters

Name | Type | Description
--- | --- | ---
$type | string |

`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.