| @@ 84-89 (lines=6) @@ | ||
| 81 | } |
|
| 82 | ||
| 83 | // make sure we have our details |
|
| 84 | if (!isset($tables->$tableName->$key)) { |
|
| 85 | $msg = "table does not contain item '{$key}'"; |
|
| 86 | $log->endAction($msg); |
|
| 87 | ||
| 88 | throw Exceptions::newExpectFailedException(__METHOD__, "{$tableName} table has item '{$key}'", "{$tableName} table has no item '{$key}'"); |
|
| 89 | } |
|
| 90 | ||
| 91 | // all done |
|
| 92 | $log->endAction(); |
|
| @@ 122-127 (lines=6) @@ | ||
| 119 | } |
|
| 120 | ||
| 121 | // make sure we don't have the details |
|
| 122 | if (isset($tables->$tableName->$key)) { |
|
| 123 | $msg = "table already contains no item '{$key}'"; |
|
| 124 | $log->endAction($msg); |
|
| 125 | ||
| 126 | throw Exceptions::newExpectFailedException(__METHOD__, "{$tableName} table has no item '{$key}'", "{$tableName} table has item '{$key}'"); |
|
| 127 | } |
|
| 128 | ||
| 129 | // all done |
|
| 130 | $log->endAction(); |
|
| @@ 223-227 (lines=5) @@ | ||
| 220 | } |
|
| 221 | ||
| 222 | // make sure we don't have a duplicate entry |
|
| 223 | if (isset($tables->$tableName->$group->$key)){ |
|
| 224 | $msg = "table already contains an entry for '{$group}->{$key}'"; |
|
| 225 | $log->endAction($msg); |
|
| 226 | throw Exceptions::newActionFailedException(__METHOD__, $msg); |
|
| 227 | } |
|
| 228 | ||
| 229 | // add the entry |
|
| 230 | $tables->$tableName->$group->$key = $value; |
|