| 1 | <?php |
||
| 25 | class PgString implements ConverterInterface |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * toPg |
||
| 29 | * |
||
| 30 | * @see ConverterInterface |
||
| 31 | */ |
||
| 32 | public function toPg($data, $type, Session $session) |
||
| 33 | { |
||
| 34 | return $data !== null |
||
| 35 | ? sprintf("%s %s", $type, $session->getConnection()->escapeLiteral($data)) |
||
| 36 | : sprintf("NULL::%s", $type) |
||
| 37 | ; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * toPgStandardFormat |
||
| 42 | * |
||
| 43 | * @see ConverterInterface |
||
| 44 | */ |
||
| 45 | public function toPgStandardFormat($data, $type, Session $session) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @see ConverterInterface |
||
| 52 | */ |
||
| 53 | public function fromPg($data, $type, Session $session) |
||
| 57 | } |
||
| 58 |