int CIBlockProperty::Add( array fields );
The method adds a new property.
Parameter | Description |
---|---|
fields |
An array in the format Array("field"=>"value").
Contains values of all fields of a
property. You can also set the options for properties of the LIST type. To do so, assign an array Array(array("VALUE"=>"value", "DEF"=>"default (Y/N)", "SORT"=>"sort weight"),...) to the field VALUES. See the UpdateEnum function description for more information. |
<? $arFields = Array( "NAME" => "Colour", "ACTIVE" => "Y", "SORT" => "100", "CODE" => "color", "PROPERTY_TYPE" => "L", "IBLOCK_ID" => 11 ); $arFields["VALUES"][0] = Array( "VALUE" => "Red", "DEF" => "N", "SORT" => "100" } $arFields["VALUES"][1] = Array( "VALUE" => "Yellow", "DEF" => "N", "SORT" => "200" } $arFields["VALUES"][2] = Array( "VALUE" => "Green", "DEF" => "Y", "SORT" => "300" } $ibp = new CIBlockProperty; $PropID = $ibp->Add($arFields); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |