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?
false
Details- 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_EOL
Details- Type
- string


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


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


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


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


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


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


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


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


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


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


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


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


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