# 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 hans@xmpl.org
package | phing.tasks.ext.pdo
since | 2.3.0

### Methods

## Construct a new PDOSQLExecFormatterElement with parent task.

    __construct(\PDOSQLExecTask $parentTask)

### Arguments

#### $parentTask

`\PDOSQLExecTask`

## Supports nested <param> element (for custom formatter classes).

    createParam() : \Parameter

### Response

`\Parameter`

## Whether output should be appended to file.

    getAppend() : boolean

### Response

`boolean`

## Gets a default output writer for this task.

    getDefaultOutput() : \Writer

### Response

`\Writer`

## Gets the formatter that has been configured based on this element.

    getFormatter() : \PDOResultFormatter

### Response

`\PDOResultFormatter`

## Get the output file.

    getOutfile() : \PhingFile

### Response

`\PhingFile`

## Gets a configured output writer.

    getOutputWriter() : \Writer

### Response

`\Writer`

## Return whether to write formatter results to file.

    getUseFile() : boolean

### Response

`boolean`

## Configures wrapped formatter class with any attributes on this element.

    prepare()

## whether output should be appended to or overwrite an existing file. Defaults to false.

    setAppend(boolean $append)

### Arguments

#### $append

`boolean`

## Set classname for a custom formatter (must extend PDOResultFormatter).

    setClassName(string $className)

### Arguments

#### $className

`string`

## Sets the column delimiter.

    setColdelim(string $v)

### Arguments

#### $v

`string`

## Set the DOM document encoding.

    setEncoding(string $v)

### Arguments

#### $v

`string`

## setFormatOutput

    setFormatOutput(boolean $v)

### Arguments

#### $v

`boolean`

## Sets the row delimiter.

    setRowdelim(string $v)

### Arguments

#### $v

`string`

## Print headers for result sets from the statements; optional, default true.

    setShowheaders(boolean $showheaders)

### Arguments

#### $showheaders

`boolean`

## Sets the formatter type.

    setType(string $type)

throws |

### Arguments

#### $type

`string`

## Set whether to write formatter results to file.

    setUseFile(boolean $useFile)

### Arguments

#### $useFile

`boolean`

### Properties

## formatter

    formatter : \PDOResultFormatter

var |

### Type(s)

`\PDOResultFormatter`

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

    type : string

var |

### Type(s)

`string`

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

    useFile : boolean

var |

### Type(s)

`boolean`

## Output file for formatter.

    outfile : \PhingFile

var |

### Type(s)

`\PhingFile`

## Print header columns.

    showheaders : boolean

var |

### Type(s)

`boolean`

## Whether to format XML output.

    formatoutput : boolean

var |

### Type(s)

`boolean`

## Encoding for XML output.

    encoding : string

var |

### Type(s)

`string`

## Column delimiter.

    coldelimiter : string

Defaults to ','

var |

### Type(s)

`string`

## Row delimiter.

    rowdelimiter : string

Defaults to PHP_EOL.

var |

### Type(s)

`string`

## Append to an existing file or overwrite it?

    append : boolean

var |

### Type(s)

`boolean`

## Parameters for a custom formatter.

    formatterParams : array

var | Parameter[]

### Type(s)

`array`

## parentTask

    parentTask : \PDOSQLExecTask

var |

### Type(s)

`\PDOSQLExecTask`