| @@ 258-282 (lines=25) @@ | ||
| 255 | ||
| 256 | } |
|
| 257 | ||
| 258 | public function commit() { |
|
| 259 | ||
| 260 | $result = []; |
|
| 261 | ||
| 262 | $active_namespace = $this->getNamespace(); |
|
| 263 | ||
| 264 | foreach ( $this->queue as $namespace => $queue ) { |
|
| 265 | ||
| 266 | $this->setNamespace($namespace); |
|
| 267 | ||
| 268 | foreach ( $queue as $key => $item ) { |
|
| 269 | ||
| 270 | $result[] = $this->save($item); |
|
| 271 | ||
| 272 | } |
|
| 273 | ||
| 274 | } |
|
| 275 | ||
| 276 | $this->queue = []; |
|
| 277 | ||
| 278 | $this->setNamespace($active_namespace); |
|
| 279 | ||
| 280 | return in_array(false, $result) ? false : true; |
|
| 281 | ||
| 282 | } |
|
| 283 | ||
| 284 | private function checkQueueNamespace($create = false) { |
|
| 285 | ||
| @@ 67-91 (lines=25) @@ | ||
| 64 | ||
| 65 | } |
|
| 66 | ||
| 67 | public function commit() { |
|
| 68 | ||
| 69 | $result = []; |
|
| 70 | ||
| 71 | $active_namespace = $this->getNamespace(); |
|
| 72 | ||
| 73 | foreach ( $this->queue as $namespace => $queue ) { |
|
| 74 | ||
| 75 | $this->setNamespace($namespace); |
|
| 76 | ||
| 77 | foreach ( $queue as $key => $item ) { |
|
| 78 | ||
| 79 | $result[] = $this->save($item); |
|
| 80 | ||
| 81 | } |
|
| 82 | ||
| 83 | } |
|
| 84 | ||
| 85 | $this->queue = []; |
|
| 86 | ||
| 87 | $this->setNamespace($active_namespace); |
|
| 88 | ||
| 89 | return in_array(false, $result) ? false : true; |
|
| 90 | ||
| 91 | } |
|
| 92 | ||
| 93 | private function checkQueueNamespace($create = false) { |
|
| 94 | ||