| @@ 269-293 (lines=25) @@ | ||
| 266 | ||
| 267 | } |
|
| 268 | ||
| 269 | public function commit() { |
|
| 270 | ||
| 271 | $result = []; |
|
| 272 | ||
| 273 | $active_namespace = $this->getNamespace(); |
|
| 274 | ||
| 275 | foreach ( $this->queue as $namespace => $queue ) { |
|
| 276 | ||
| 277 | $this->setNamespace($namespace); |
|
| 278 | ||
| 279 | foreach ( $queue as $key => $item ) { |
|
| 280 | ||
| 281 | $result[] = $this->save($item); |
|
| 282 | ||
| 283 | } |
|
| 284 | ||
| 285 | } |
|
| 286 | ||
| 287 | $this->queue = []; |
|
| 288 | ||
| 289 | $this->setNamespace($active_namespace); |
|
| 290 | ||
| 291 | return in_array(false, $result) ? false : true; |
|
| 292 | ||
| 293 | } |
|
| 294 | ||
| 295 | private function checkQueueNamespace($create = false) { |
|
| 296 | ||
| @@ 65-89 (lines=25) @@ | ||
| 62 | ||
| 63 | } |
|
| 64 | ||
| 65 | public function commit() { |
|
| 66 | ||
| 67 | $result = []; |
|
| 68 | ||
| 69 | $active_namespace = $this->getNamespace(); |
|
| 70 | ||
| 71 | foreach ( $this->queue as $namespace => $queue ) { |
|
| 72 | ||
| 73 | $this->setNamespace($namespace); |
|
| 74 | ||
| 75 | foreach ( $queue as $key => $item ) { |
|
| 76 | ||
| 77 | $result[] = $this->save($item); |
|
| 78 | ||
| 79 | } |
|
| 80 | ||
| 81 | } |
|
| 82 | ||
| 83 | $this->queue = []; |
|
| 84 | ||
| 85 | $this->setNamespace($active_namespace); |
|
| 86 | ||
| 87 | return in_array(false, $result) ? false : true; |
|
| 88 | ||
| 89 | } |
|
| 90 | ||
| 91 | private function checkQueueNamespace($create = false) { |
|
| 92 | ||