| @@ 84-88 (lines=5) @@ | ||
| 81 | } |
|
| 82 | ||
| 83 | // make sure we don't have a duplicate entry |
|
| 84 | if (isset($tables->$tableName->$key)){ |
|
| 85 | $msg = "Table already contains an entry for '{$key}'"; |
|
| 86 | $log->endAction($msg); |
|
| 87 | throw Exceptions::newActionFailedException(__METHOD__, $msg); |
|
| 88 | } |
|
| 89 | ||
| 90 | // add the entry |
|
| 91 | $tables->$tableName->$key = $value; |
|
| @@ 130-134 (lines=5) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | // make sure we have an entry to remove |
|
| 130 | if (!isset($tables->$tableName->$key)) { |
|
| 131 | $msg = "table does not contain an entry for '{$key}'"; |
|
| 132 | $log->endAction($msg); |
|
| 133 | return; |
|
| 134 | } |
|
| 135 | ||
| 136 | // remove the entry |
|
| 137 | unset($tables->$tableName->$key); |
|
| @@ 273-277 (lines=5) @@ | ||
| 270 | $log->endAction($msg); |
|
| 271 | return; |
|
| 272 | } |
|
| 273 | if (!isset($tables->$tableName->$group)) { |
|
| 274 | $msg = "table has no group '{$group}'. '{$group}->{$key}' not removed"; |
|
| 275 | $log->endAction($msg); |
|
| 276 | return; |
|
| 277 | } |
|
| 278 | if (!isset($tables->$tableName->$group->$key)) { |
|
| 279 | $msg = "table does not contain an entry for '{$group}->{$key}'"; |
|
| 280 | $log->endAction($msg); |
|
| @@ 278-282 (lines=5) @@ | ||
| 275 | $log->endAction($msg); |
|
| 276 | return; |
|
| 277 | } |
|
| 278 | if (!isset($tables->$tableName->$group->$key)) { |
|
| 279 | $msg = "table does not contain an entry for '{$group}->{$key}'"; |
|
| 280 | $log->endAction($msg); |
|
| 281 | return; |
|
| 282 | } |
|
| 283 | ||
| 284 | // remove the entry |
|
| 285 | unset($tables->$tableName->$group->$key); |
|
| @@ 76-81 (lines=6) @@ | ||
| 73 | $tables = $this->getAllTables(); |
|
| 74 | ||
| 75 | // make sure we have our runtime table |
|
| 76 | if (!isset($tables->$tableName)) { |
|
| 77 | $msg = "table is empty / does not exist"; |
|
| 78 | $log->endAction($msg); |
|
| 79 | ||
| 80 | throw Exceptions::newExpectFailedException(__METHOD__, "{$tableName} table existed", "{$tableName} table does not exist"); |
|
| 81 | } |
|
| 82 | ||
| 83 | // make sure we have our details |
|
| 84 | if (!isset($tables->$tableName->$key)) { |
|
| @@ 138-142 (lines=5) @@ | ||
| 135 | } |
|
| 136 | ||
| 137 | // do we have the entry we're looking for? |
|
| 138 | if (!isset($tables->$tableName->$key)) { |
|
| 139 | $msg = "table does not contain an entry for '{$key}'"; |
|
| 140 | $log->endAction($msg); |
|
| 141 | return null; |
|
| 142 | } |
|
| 143 | ||
| 144 | // all done |
|
| 145 | $log->endAction(); |
|
| @@ 178-183 (lines=6) @@ | ||
| 175 | } |
|
| 176 | ||
| 177 | // make sure we have the group |
|
| 178 | if (!isset($tables->$tableName->$group)) { |
|
| 179 | $msg = "table has no group '{$group}'"; |
|
| 180 | $log->endAction($msg); |
|
| 181 | ||
| 182 | return null; |
|
| 183 | } |
|
| 184 | ||
| 185 | // do we have the entry we're looking for? |
|
| 186 | if (!isset($tables->$tableName->$group->$key)) { |
|
| @@ 186-190 (lines=5) @@ | ||
| 183 | } |
|
| 184 | ||
| 185 | // do we have the entry we're looking for? |
|
| 186 | if (!isset($tables->$tableName->$group->$key)) { |
|
| 187 | $msg = "table does not contain an entry for '{$group}->{$key}'"; |
|
| 188 | $log->endAction($msg); |
|
| 189 | return null; |
|
| 190 | } |
|
| 191 | ||
| 192 | // all done |
|
| 193 | $log->endAction(); |
|