| @@ 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 | ||
| @@ 305-329 (lines=25) @@ | ||
| 302 | /** |
|
| 303 | * {@inheritdoc} |
|
| 304 | */ |
|
| 305 | public function commit() { |
|
| 306 | ||
| 307 | $result = []; |
|
| 308 | ||
| 309 | $active_namespace = $this->getNamespace(); |
|
| 310 | ||
| 311 | foreach ( $this->queue as $namespace => $queue ) { |
|
| 312 | ||
| 313 | $this->setNamespace($namespace); |
|
| 314 | ||
| 315 | foreach ( $queue as $key => $item ) { |
|
| 316 | ||
| 317 | $result[] = $this->save($item); |
|
| 318 | ||
| 319 | } |
|
| 320 | ||
| 321 | } |
|
| 322 | ||
| 323 | $this->queue = []; |
|
| 324 | ||
| 325 | $this->setNamespace($active_namespace); |
|
| 326 | ||
| 327 | return in_array(false, $result) ? false : true; |
|
| 328 | ||
| 329 | } |
|
| 330 | ||
| 331 | private function checkQueueNamespace($create = false) { |
|
| 332 | ||