| @@ 47-54 (lines=8) @@ | ||
| 44 | * |
|
| 45 | * @see ConverterInterface |
|
| 46 | */ |
|
| 47 | public function toPg($data, $type, Session $session) |
|
| 48 | { |
|
| 49 | return |
|
| 50 | $data !== null |
|
| 51 | ? sprintf("%s '%s'", $type, $this->checkData($data)->format(static::TS_FORMAT)) |
|
| 52 | : sprintf("NULL::%s", $type) |
|
| 53 | ; |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * toPgStandardFormat |
|
| @@ 50-56 (lines=7) @@ | ||
| 47 | /** |
|
| 48 | * @see ConverterInterface |
|
| 49 | */ |
|
| 50 | public function toPg($data, $type, Session $session) |
|
| 51 | { |
|
| 52 | return $data !== null |
|
| 53 | ? sprintf("%s '%s'", $type, $this->checkData($data)->format('%Y years %M months %D days %H:%i:%S')) |
|
| 54 | : sprintf("NULL::%s", $type) |
|
| 55 | ; |
|
| 56 | } |
|
| 57 | ||
| 58 | ||
| 59 | /** |
|
| @@ 62-68 (lines=7) @@ | ||
| 59 | /** |
|
| 60 | * @see ConverterInterface |
|
| 61 | */ |
|
| 62 | public function toPgStandardFormat($data, $type, Session $session) |
|
| 63 | { |
|
| 64 | return $data !== null |
|
| 65 | ? sprintf('"%s"', $this->checkData($data)->format('%Y years %M months %D days %H:%i:%S')) |
|
| 66 | : null |
|
| 67 | ; |
|
| 68 | } |
|
| 69 | ||
| 70 | /** |
|
| 71 | * checkData |
|
| @@ 77-84 (lines=8) @@ | ||
| 74 | * |
|
| 75 | * @see ConverterInterface |
|
| 76 | */ |
|
| 77 | public function toPg($data, $type, Session $session) |
|
| 78 | { |
|
| 79 | return |
|
| 80 | $data !== null |
|
| 81 | ? sprintf("%s('%s')", $type, $this->checkData($data)) |
|
| 82 | : sprintf("NULL::%s", $type) |
|
| 83 | ; |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * toPgStandardFormat |
|
| @@ 91-98 (lines=8) @@ | ||
| 88 | * |
|
| 89 | * @see ConverterInterface |
|
| 90 | */ |
|
| 91 | public function toPgStandardFormat($data, $type, Session $session) |
|
| 92 | { |
|
| 93 | return |
|
| 94 | $data !== null |
|
| 95 | ? sprintf("%s", str_replace('"', '""', (string) $this->checkData($data))) |
|
| 96 | : null |
|
| 97 | ; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * checkData |
|