24 $albumsFromVk = $apiHelper->getALbumsFromVk($this->vkGroupId);
25 $albumsMapped = Vk\Map::getMappedAlbums($this->exportId);
27 $albumsMappedToRemove = array();
28 foreach ($albumsMapped as $key => $albumMapped)
30 if (!isset($albumsFromVk[$albumMapped[
"ALBUM_VK_ID"]]))
32 $albumsMappedToRemove[] = array(
"VALUE_EXTERNAL" => $albumMapped[
"ALBUM_VK_ID"]);
33 unset($albumsMapped[$key]);
37 if (!empty($albumsMappedToRemove))
38 Vk\Map::removeAlbumMapping($albumsMappedToRemove, $this->exportId);
43 foreach ($albumsMapped as $chunk)
45 $resDelete = $this->executer->executeMarketAlbumDelete(array(
46 "owner_id" => $this->vkGroupId,
48 "count" => count($chunk),
51 foreach ($resDelete as $res)
53 if ($res[
"flag_album_delete_result"])
54 $albumsMappedToRemove[] = array(
"VALUE_EXTERNAL" => $res[
"ALBUM_VK_ID"]);
58 if (!empty($albumsMappedToRemove))
59 Vk\Map::removeAlbumMapping($albumsMappedToRemove, $this->exportId);
62 if ($timer !== NULL && !$timer->check())
68 $vkExportedData->removeData();