$PRICE_TYPE_ID = 1;
$IBLOCK_ID = 8;
$res = CIBlockElement::GetList([], ["IBLOCK_ID" => $IBLOCK_ID], false, false, ["ID"]);
while ($item = $res->Fetch())
{
$PRODUCT_ID = $item["ID"];
$arFields = Array(
"PRODUCT_ID" => $PRODUCT_ID,
"CATALOG_GROUP_ID" => $PRICE_TYPE_ID,
"PRICE" => 1,
"CURRENCY" => "RUB",
);
$res = CPrice::GetList(
array(),
array(
"PRODUCT_ID" => $PRODUCT_ID,
"CATALOG_GROUP_ID" => $PRICE_TYPE_ID
)
);
if ($arr = $res->Fetch())
{
CPrice::Update($arr["ID"], $arFields);
}
else
{
CPrice::Add($arFields);
}
}
Array
(
[0] => Array
(
[host] => php.net
[type] => MX
[pri] => 5
[target] => pair2.php.net
[class] => IN
[ttl] => 6765
)
[1] => Array
(
[host] => php.net
[type] => A
[ip] => 64.246.30.37
[class] => IN
[ttl] => 8125
)
)
$count = 0;
$found = false;
$last_position = 0;
$last_string = "";
$search = "abrakadabra";
$fp = fopen('somefile.txt', 'r');
do {
fseek($fp, $last_position);
$last_string = "";
while (($buffer = fgets($fp)) !== false) {
$last_string .= $buffer;
}
if (strpos($last_string, $search) !== false) {
$found = true;
}
$last_position += strlen($last_string);
$count += 1;
sleep(2);
} while($found == false && $count < 10);
if ($found == true) {
echo "Текст найден!";
}
$tableName = "b_hlbd_manufacturer";
$hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(
array("filter" => array(
'TABLE_NAME' => $tableName
))
)->fetch();
if (isset($hlblock['ID']))
{
$entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$res = $entity_data_class::getList( array('filter'=>array()) );
while ($item = $res->fetch()
{
// .... la .. la .. la
}
// или так $arAllRows = $res->fetchAll();
}