tasks/ext/pdo/PDOSQLExecFormatterElement.php
\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 |