| @@ 136-140 (lines=5) @@ | ||
| 133 | } |
|
| 134 | ||
| 135 | // do we have the entry we're looking for? |
|
| 136 | if (!isset($tables->$tableName->$key)) { |
|
| 137 | $msg = "table does not contain an entry for '{$key}'"; |
|
| 138 | $log->endAction($msg); |
|
| 139 | return null; |
|
| 140 | } |
|
| 141 | ||
| 142 | // all done |
|
| 143 | $log->endAction(); |
|
| @@ 175-180 (lines=6) @@ | ||
| 172 | } |
|
| 173 | ||
| 174 | // make sure we have the group |
|
| 175 | if (!isset($tables->$tableName->$group)) { |
|
| 176 | $msg = "table has no group '{$group}'"; |
|
| 177 | $log->endAction($msg); |
|
| 178 | ||
| 179 | return null; |
|
| 180 | } |
|
| 181 | ||
| 182 | // do we have the entry we're looking for? |
|
| 183 | if (!isset($tables->$tableName->$group->$key)) { |
|
| @@ 183-187 (lines=5) @@ | ||
| 180 | } |
|
| 181 | ||
| 182 | // do we have the entry we're looking for? |
|
| 183 | if (!isset($tables->$tableName->$group->$key)) { |
|
| 184 | $msg = "table does not contain an entry for '{$group}->{$key}'"; |
|
| 185 | $log->endAction($msg); |
|
| 186 | return null; |
|
| 187 | } |
|
| 188 | ||
| 189 | // all done |
|
| 190 | $log->endAction(); |
|
| @@ 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); |
|
| @@ 271-275 (lines=5) @@ | ||
| 268 | $log->endAction($msg); |
|
| 269 | return; |
|
| 270 | } |
|
| 271 | if (!isset($tables->$tableName->$group)) { |
|
| 272 | $msg = "table has no group '{$group}'. '{$group}->{$key}' not removed"; |
|
| 273 | $log->endAction($msg); |
|
| 274 | return; |
|
| 275 | } |
|
| 276 | if (!isset($tables->$tableName->$group->$key)) { |
|
| 277 | $msg = "table does not contain an entry for '{$group}->{$key}'"; |
|
| 278 | $log->endAction($msg); |
|
| @@ 276-280 (lines=5) @@ | ||
| 273 | $log->endAction($msg); |
|
| 274 | return; |
|
| 275 | } |
|
| 276 | if (!isset($tables->$tableName->$group->$key)) { |
|
| 277 | $msg = "table does not contain an entry for '{$group}->{$key}'"; |
|
| 278 | $log->endAction($msg); |
|
| 279 | return; |
|
| 280 | } |
|
| 281 | ||
| 282 | // remove the entry |
|
| 283 | unset($tables->$tableName->$group->$key); |
|