# tasks/ext/pdo/PDOSQLExecFormatterElement.php

$Id: PDOSQLExecFormatterElement.php 1037 2011-02-08 10:16:34Z mrook $

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.

## \PDOSQLExecFormatterElement
jump to top

Package: phing\tasks\ext\pdo

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

Default value`""`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 ) : void`

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( ) : void`

Configures wrapped formatter class with any attributes on this element.

`setAppend( boolean $append ) : void`

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

Parameters

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

`setClassName( string $className ) : void`

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

Parameters

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

`setColdelim( string $v ) : void`

Sets the column delimiter.

Parameters

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

`setEncoding( string $v ) : void`

Set the DOM document encoding.

Parameters

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

`setFormatOutput( boolean $v ) : void`

Parameters

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

`setOutfile( $outfile ) : void`

Sets the output file for the formatter results.

Parameters

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

`setRowdelim( string $v ) : void`

Sets the row delimiter.

Parameters

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

`setShowheaders( boolean $showheaders ) : void`

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

Parameters

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

`setType( string $type ) : void`

Sets the formatter type.

Parameters

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

`setUseFile( boolean $useFile ) : void`

Set whether to write formatter results to file.

Parameters

Name | Type | Description
--- | --- | ---
$useFile | boolean |

Documentation was generated by DocBlox 0.15.1.