| @@ 32-41 (lines=10) @@ | ||
| 29 | * |
|
| 30 | * @see ConverterInterface |
|
| 31 | */ |
|
| 32 | public function fromPg($data, $type, Session $session) |
|
| 33 | { |
|
| 34 | $data = trim($data); |
|
| 35 | ||
| 36 | if ($data === '') { |
|
| 37 | return null; |
|
| 38 | } |
|
| 39 | ||
| 40 | return $data + 0; |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * toPg |
|
| @@ 48-55 (lines=8) @@ | ||
| 45 | * |
|
| 46 | * @see ConverterInterface |
|
| 47 | */ |
|
| 48 | public function toPg($data, $type, Session $session) |
|
| 49 | { |
|
| 50 | return |
|
| 51 | $data !== null |
|
| 52 | ? sprintf("%s '%s'", $type, $data + 0) |
|
| 53 | : sprintf("NULL::%s", $type) |
|
| 54 | ; |
|
| 55 | } |
|
| 56 | ||
| 57 | /** |
|
| 58 | * toPgStandardFormat |
|