tasks/ext/pdo/PDOSQLExecFormatterElement.php

Show: inherited
Table of Contents

$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

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

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 valuearray()Details
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).

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

Construct a new PDOSQLExecFormatterElement with parent task.

Parameters
Name Type Description
$parentTask \PDOSQLExecTask
methodpubliccreateParam( ) : \Parameter

Supports nested element (for custom formatter classes).

Returns
Type Description
\Parameter
methodpublicgetAppend( ) : boolean

Whether output should be appended to file.

Returns
Type Description
boolean
methodprivategetDefaultOutput( ) : \Writer

Gets a default output writer for this task.

Returns
Type Description
\Writer
methodpublicgetFormatter( ) : \PDOResultFormatter

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

Returns
Type Description
\PDOResultFormatter
methodpublicgetOutfile( ) : \PhingFile

Get the output file.

Returns
Type Description
\PhingFile
methodprivategetOutputWriter( ) : \Writer

Gets a configured output writer.

Returns
Type Description
\Writer
methodpublicgetUseFile( ) : boolean

Return whether to write formatter results to file.

Returns
Type Description
boolean
methodpublicprepare( ) : void

Configures wrapped formatter class with any attributes on this element.

methodpublicsetAppend( boolean $append ) : void

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

Parameters
Name Type Description
$append boolean
methodpublicsetClassName( string $className ) : void

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

Parameters
Name Type Description
$className string
methodpublicsetColdelim( string $v ) : void

Sets the column delimiter.

Parameters
Name Type Description
$v string
methodpublicsetEncoding( string $v ) : void

Set the DOM document encoding.

Parameters
Name Type Description
$v string
methodpublicsetFormatOutput( boolean $v ) : void

Parameters
Name Type Description
$v boolean
methodpublicsetOutfile(  $outfile ) : void

Sets the output file for the formatter results.

Parameters
Name Type Description
$outfile
methodpublicsetRowdelim( string $v ) : void

Sets the row delimiter.

Parameters
Name Type Description
$v string
methodpublicsetShowheaders( boolean $showheaders ) : void

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

Parameters
Name Type Description
$showheaders boolean
methodpublicsetType( string $type ) : void

Sets the formatter type.

Parameters
Name Type Description
$type string
methodpublicsetUseFile( 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.