<?php
/* Добавление GUID */
header("Content-type: text/html; charset=UTF-8");
// Подключаем основные классы
require_once ('bootstrap.php');
$oInformationsystem = Core_Entity::factory('Informationsystem', 1); //ID ИС
$i = $k = 0;
$offset = 0;
$limit = 100; //Количество элементов за шаг
/* Группы */
do {
$oInformationsystem_Groups = $oInformationsystem->Informationsystem_Groups;
$oInformationsystem_Groups->queryBuilder()
->where('informationsystem_groups.deleted', '=', 0)
// ->where('informationsystem_groups.active', '=', 1)
->offset($offset)
->limit($limit);
$aInformationsystem_Groups = $oInformationsystem_Groups->findAll(FALSE);
foreach ($aInformationsystem_Groups as $oInformationsystem_Group)
{
$oInformationsystem_Group
->guid(Core_Guid::get())
->save();
$i++;
}
$offset += $limit;
}
while (count($aInformationsystem_Groups));
echo '<h1>Обновлено групп ', $i, '</h1><br/>';
$offset = 0;
$limit = 100; //Количество элементов за шаг
/* Элементы */
do {
$oInformationsystem_Items = $oInformationsystem->Informationsystem_Items;
$oInformationsystem_Items->queryBuilder()
->where('informationsystem_items.deleted', '=', 0)
->where('informationsystem_items.active', '=', 1)
->offset($offset)
->limit($limit);
$aInformationsystem_Items = $oInformationsystem_Items->findAll(FALSE);
foreach ($aInformationsystem_Items as $oInformationsystem_Item)
{
$oInformationsystem_Item
->guid(Core_Guid::get())
->save();
$k++;
}
$offset += $limit;
}
while (count($aInformationsystem_Items));
echo '<h1>Обновлено товаров ', $k, '</h1>';