| @@ 75-86 (lines=12) @@ | ||
| 72 | /** |
|
| 73 | * {@inheritdoc} |
|
| 74 | */ |
|
| 75 | public function get($key, $default = null) |
|
| 76 | { |
|
| 77 | KeyUtil::validate($key); |
|
| 78 | ||
| 79 | $dbResult = $this->getDbRow($key); |
|
| 80 | ||
| 81 | if (null === $dbResult) { |
|
| 82 | return $default; |
|
| 83 | } |
|
| 84 | ||
| 85 | return Serializer::unserialize($dbResult['meta_value']); |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * {@inheritdoc} |
|
| @@ 91-102 (lines=12) @@ | ||
| 88 | /** |
|
| 89 | * {@inheritdoc} |
|
| 90 | */ |
|
| 91 | public function getOrFail($key) |
|
| 92 | { |
|
| 93 | KeyUtil::validate($key); |
|
| 94 | ||
| 95 | $dbResult = $this->getDbRow($key); |
|
| 96 | ||
| 97 | if (null === $dbResult) { |
|
| 98 | throw NoSuchKeyException::forKey($key); |
|
| 99 | } |
|
| 100 | ||
| 101 | return Serializer::unserialize($dbResult['meta_value']); |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * {@inheritdoc} |
|