|
@@ 232-241 (lines=10) @@
|
| 229 |
|
$oldPrograms = $this->findVisitorPrograms($visitorId); |
| 230 |
|
|
| 231 |
|
// update old data to new existing |
| 232 |
|
foreach($programBlocks as $programBlock) { |
| 233 |
|
// read first value from array and shift it to the end |
| 234 |
|
$oldProgram = array_shift($oldPrograms); |
| 235 |
|
|
| 236 |
|
$this->updateOrCreateProgram( |
| 237 |
|
$visitorId, |
| 238 |
|
(empty($oldProgram)) ? $oldProgram : $oldProgram->id, |
| 239 |
|
$programs[$programBlock->id] |
| 240 |
|
); |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
return $visitorId; |
| 244 |
|
} |
|
@@ 276-285 (lines=10) @@
|
| 273 |
|
$oldPrograms = $this->findVisitorPrograms($visitor->id); |
| 274 |
|
|
| 275 |
|
// update old data to new existing |
| 276 |
|
foreach($programBlocks as $programBlock) { |
| 277 |
|
// read first value from array and shift it to the end |
| 278 |
|
$oldProgram = array_shift($oldPrograms); |
| 279 |
|
|
| 280 |
|
$this->updateOrCreateProgram( |
| 281 |
|
$visitor->id, |
| 282 |
|
(empty($oldProgram)) ? $oldProgram : $oldProgram->id, |
| 283 |
|
$programs[$programBlock->id] |
| 284 |
|
); |
| 285 |
|
} |
| 286 |
|
|
| 287 |
|
return $guid; |
| 288 |
|
} |