1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
albumsdeleteall.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\TradingPlatform\Vk\Feed\Data\Processors;
4
5
6use Bitrix\Sale\TradingPlatform\Vk;
7use Bitrix\Sale\TradingPlatform\Timer;
8use Bitrix\Sale\TradingPlatform\TimeIsOverException;
9
15{
22 public function process($data = NULL, Timer $timer = NULL)
23 {
24 $apiHelper = new Vk\Api\ApiHelper($this->exportId);
25 $albumsFromVk = $apiHelper->getALbumsFromVk($this->vkGroupId, false);
26 $albumsMapped = Vk\Map::getMappedAlbums($this->exportId);
27
28// delete ALL from mapping
29 $albumsMappedToRemove = array();
30 foreach ($albumsMapped as $albumMapped)
31 {
32 $albumsMappedToRemove[] = array("VALUE_EXTERNAL" => $albumMapped["ALBUM_VK_ID"]);
33 }
34
35 if (!empty($albumsMappedToRemove))
36 {
37 Vk\Map::removeAlbumMapping($albumsMappedToRemove, $this->exportId);
38 }
39
40
41// formatted data
42 foreach ($albumsFromVk as &$album)
43 {
44 $album = array('ALBUM_VK_ID' => $album);
45 }
46 $albumsFromVk = array_chunk($albumsFromVk, Vk\Vk::MAX_EXECUTION_ITEMS); // max 25 items in execute()
47 foreach ($albumsFromVk as $chunk)
48 {
49 $this->executer->executeMarketAlbumDelete(array(
50 "owner_id" => $this->vkGroupId,
51 "data" => $chunk,
52 "count" => count($chunk),
53 ));
54
55// abstract start position - only for continue export, not for rewind to position
56 if ($timer !== NULL && !$timer->check())
57 throw new TimeIsOverException("Timelimit for export is over", '1');
58 }
59
60// remove products from cache
61 $vkExportedData = new Vk\VkExportedData($this->exportId, 'ALBUMS');
62 $vkExportedData->removeData();
63
64 return true;
65 }
66}
static removeAlbumMapping($values, $exportId, $flagKeys='')
Определения map.php:133
static getMappedAlbums($exportId)
Определения map.php:368
const MAX_EXECUTION_ITEMS
Определения vk.php:33
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936