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