| @@ 51-66 (lines=16) @@ | ||
| 48 | return $instances[$key]; |
|
| 49 | } |
|
| 50 | ||
| 51 | public function convertToSQL($value) |
|
| 52 | { |
|
| 53 | if ($value === null) { |
|
| 54 | return null; |
|
| 55 | } |
|
| 56 | ||
| 57 | if ($value === true) { |
|
| 58 | return $this->true_value; |
|
| 59 | } |
|
| 60 | ||
| 61 | if ($value === false) { |
|
| 62 | return $this->false_value; |
|
| 63 | } |
|
| 64 | ||
| 65 | throw new InvalidArgumentException("unexpected value: " . print_r($value)); |
|
| 66 | } |
|
| 67 | ||
| 68 | public function convertToPHP($value) |
|
| 69 | { |
|
| @@ 68-83 (lines=16) @@ | ||
| 65 | throw new InvalidArgumentException("unexpected value: " . print_r($value)); |
|
| 66 | } |
|
| 67 | ||
| 68 | public function convertToPHP($value) |
|
| 69 | { |
|
| 70 | if ($value === null) { |
|
| 71 | return null; |
|
| 72 | } |
|
| 73 | ||
| 74 | if ($value === $this->true_value) { |
|
| 75 | return true; |
|
| 76 | } |
|
| 77 | ||
| 78 | if ($value === $this->false_value) { |
|
| 79 | return false; |
|
| 80 | } |
|
| 81 | ||
| 82 | throw new InvalidArgumentException("unexpected value: " . print_r($value)); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||