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
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?
falseDetails- Type
- boolean

array
$formatterParams= 'array()'
Parameters for a custom formatter.
Parameter[]array()Details- Type
- array

string
$rowdelimiter= 'PHP_EOL'
Row delimiter.
Defaults to PHP_EOL.
PHP_EOLDetails- Type
- string

string
$type= '""'
The type of the formatter (used for built-in formatter classes).
""Details- Type
- string
Methods

__construct(
\PDOSQLExecTask $parentTask
)
:
voidConstruct a new PDOSQLExecFormatterElement with parent task.
| Name | Type | Description |
|---|---|---|
| $parentTask | \PDOSQLExecTask |

createParam(
)
:
\ParameterSupports nested element (for custom formatter classes).
| Type | Description |
|---|---|
| \Parameter |

getDefaultOutput(
)
:
\WriterGets a default output writer for this task.
| Type | Description |
|---|---|
| \Writer |

getFormatter(
)
:
\PDOResultFormatterGets the formatter that has been configured based on this element.
| Type | Description |
|---|---|
| \PDOResultFormatter |

getUseFile(
)
:
booleanReturn whether to write formatter results to file.
| Type | Description |
|---|---|
| boolean |

setAppend(
boolean $append
)
:
voidwhether output should be appended to or overwrite an existing file. Defaults to false.
| Name | Type | Description |
|---|---|---|
| $append | boolean |

setClassName(
string $className
)
:
voidSet classname for a custom formatter (must extend PDOResultFormatter).
| Name | Type | Description |
|---|---|---|
| $className | string |

setColdelim(
string $v
)
:
voidSets the column delimiter.
| Name | Type | Description |
|---|---|---|
| $v | string |

setEncoding(
string $v
)
:
voidSet the DOM document encoding.
| Name | Type | Description |
|---|---|---|
| $v | string |

setOutfile(
$outfile
)
:
voidSets the output file for the formatter results.
| Name | Type | Description |
|---|---|---|
| $outfile |

setShowheaders(
boolean $showheaders
)
:
voidPrint headers for result sets from the statements; optional, default true.
| Name | Type | Description |
|---|---|---|
| $showheaders | boolean |

setType(
string $type
)
:
voidSets the formatter type.
| Name | Type | Description |
|---|---|---|
| $type | string |