mdref.json config
[mdref/mdref-pq] / pq / Converter / convertToString.md
1 # string pq\Converter::convertToString(mixed $value, int $type)
2
3 Convert a value to a string for use in a query.
4
5 ## Params:
6
7 * mixed $value
8 The PHP value which should be converted to a string.
9 * int $type
10 The type OID the converter should handle. Irrelevant for singly-type converters.
11
12 ## Returns:
13
14 * string, a textual representation of the value accepted by the PostgreSQL server.
15
16 ## Example:
17
18 <?php
19
20 abstract class Example implements pq\Converter {
21 function convertToString($uuid, $type) {
22 return uuid_unparse($uuid);
23 }
24 }
25
26 ?>