You are here

public function InstapageCmsPluginPageModel::mergeListPagesResults in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/models/InstapageCmsPluginPageModel.php \InstapageCmsPluginPageModel::mergeListPagesResults()

Gets the data about landing pages stores in local database and completes them with data from Instapage app.

Parameters

array localData List of pages stored locally. Data will be changed during the process.:

array $appData List of information from the Instapage app.:

File

core/models/InstapageCmsPluginPageModel.php, line 373

Class

InstapageCmsPluginPageModel
Class responsible for managing the landing pages.

Code

public function mergeListPagesResults(&$localData, $appData) {
  foreach ($localData as &$localItem) {
    $instapageId = $localItem->instapage_id;
    $appItem = $this
      ->getPageFromArray($instapageId, $appData);
    if (!is_null($appItem)) {
      $localItem->screenshot = $appItem->screenshot;
      $localItem->title = $appItem->title;
      $localItem->subaccount = $appItem->subaccount;
    }
  }
}