Add
Description and parameters
mixed CCatalogImport::Add( array arFields );
Method adds new import profile. Non-static method.
Note: You cannot avoid CheckFIelds when entering values to this method, with a single exception:
"=LAST_USE" => $DB->GetNowFunction()
Call parameters
Parameters | Description |
---|---|
arFields | Available fields:
|
Returned value
Method returns code for inserted record or false otherwise.
Examples
Adding a pre-set CSV import profile that requires a setup:
$arFields = array( "FILE_NAME" => "csv_new", "NAME" => "My import", "NEED_EDIT" => "Y", "SETUP_VARS" => false ); CCatalogImport::Add($arFields);
Adding a profile with specified time of last use (current time only). Displays it in the left menu:
$arFields = array( "FILE_NAME" => "csv_new", "NAME" => "My second import", "=LAST_USE" => $DB->GetNowFunction, "IN_MENU" => "Y", "SETUP_VARS" => "IBLOCK_ID=15&FILE_DATE=import.csv" // set of parameters is quite relative ); CCatalogImport::Add($arFields);
Adding profile with user who created the profile:
$arFields = array( "FILE_NAME" => "csv_new", "NAME" => "My second import", "=LAST_USE" => $DB->GetNowFunction, "IN_MENU" => "Y", "SETUP_VARS" => "IBLOCK_ID=15&FILE_DATE=import.csv", // set of parameters is quite relative "CREATED_BY" => 15, // user with ID = 15 "MODIFIED_BY" => 15 // must match with CREATED_BY ); CCatalogImport::Add($arFields);
© «Bitrix24», 2001-2024