- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
//получаем Элемент
$resource = CIBlockElement::GetByID($Bid);
if ($ob = $resource->GetNextElement())
{
//вытягиваем поля, свойства
$arFields = $ob->GetFields();
$arFields['PROPERTIES'] = $ob->GetProperties();
// удаляем все поля, нахрен мы их вообще выдергивали
$arFieldsCopy = $arFields;
unset(
$arFieldsCopy['ID'],
$arFieldsCopy['~ID'],
$arFieldsCopy['IBLOCK_SECTION_ID'],
$arFieldsCopy['~IBLOCK_SECTION_ID'],
$arFieldsCopy['TIMESTAMP_X'],
$arFieldsCopy['~TIMESTAMP_X'],
$arFieldsCopy['ACTIVE_TO'],
$arFieldsCopy['~ACTIVE_TO'],
$arFieldsCopy['DATE_ACTIVE_TO'],
$arFieldsCopy['~DATE_ACTIVE_TO'],
$arFieldsCopy['PREVIEW_PICTURE'],
$arFieldsCopy['~PREVIEW_PICTURE'],
$arFieldsCopy['PREVIEW_TEXT'],
$arFieldsCopy['~PREVIEW_TEXT'],
$arFieldsCopy['DETAIL_PICTURE'],
$arFieldsCopy['~DETAIL_PICTURE'],
$arFieldsCopy['DETAIL_TEXT'],
$arFieldsCopy['~DETAIL_TEXT'],
$arFieldsCopy['XML_ID'],
$arFieldsCopy['~XML_ID'],
$arFieldsCopy['EXTERNAL_ID'],
$arFieldsCopy['~EXTERNAL_ID'],
$arFieldsCopy['TMP_ID'],
$arFieldsCopy['~TMP_ID'],
$arFieldsCopy['CODE'],
$arFieldsCopy['~CODE'],
$arFieldsCopy['SEARCHABLE_CONTENT'],
$arFieldsCopy['~SEARCHABLE_CONTENT'],
$arFieldsCopy['WF_LAST_HISTORY_ID'],
$arFieldsCopy['~WF_LAST_HISTORY_ID'],
$arFieldsCopy['WF_COMMENTS'],
$arFieldsCopy['~WF_COMMENTS'],
$arFieldsCopy['WF_DATE_LOCK'],
$arFieldsCopy['~WF_DATE_LOCK'],
$arFieldsCopy['WF_LOCKED_BY'],
$arFieldsCopy['~WF_LOCKED_BY'],
$arFieldsCopy['WF_NEW'],
$arFieldsCopy['~WF_NEW'],
$arFieldsCopy['WF_PARENT_ELEMENT_ID'],
$arFieldsCopy['~WF_PARENT_ELEMENT_ID'],
$arFieldsCopy['SHOW_COUNTER'],
$arFieldsCopy['~SHOW_COUNTER'],
$arFieldsCopy['TAGS'],
$arFieldsCopy['~TAGS'],
$arFieldsCopy['LOCKED_USER_NAME'],
$arFieldsCopy['~LOCKED_USER_NAME'],
$arFieldsCopy['SHOW_COUNTER_START'],
$arFieldsCopy['~SHOW_COUNTER_START']
);
$arFieldsCopy['ACTIVE']='N';
$arFieldsCopy['ACTIVE_FROM']=date('d.m.Y');
/*... тра тра та заполняю я поля ....*/
$arFieldsCopy['PROPERTY_VALUES'] = [
/* ... тра та та,
тра та та,
заполняю свойства я
...
*/
];
/*
... Продолжая песню петь
удалю я все теперь
...
*/
unset($arFieldsCopy['PROPERTIES']);
// кульминация пьесы, добавление нового Элемента
$el = new CIBlockElement();
$NEW_BID_ID = $el->Add($arFieldsCopy);
}
Эм.... толи память экономит, то ли оплата за код построчно ....