Last active
July 25, 2017 15:18
-
-
Save jasp402/1fdb00e5918817d1cc9ba17b6279efdf to your computer and use it in GitHub Desktop.
PHP - Bitrix (Clear fields, get list since infoBlock and set field name want clear)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CModule::IncludeModule("iblock"); | |
$ob=CIblockElement::GetList( | |
array(), | |
array("IBLOCK_ID"=>62, "PROPERTY_PORTAL" =>885), | |
false, | |
false, | |
array("ID","PROPERTY_LAST_EXECUTION")); | |
while ($res = $ob->GetNextElement()) { | |
$arFields = $res->GetFields(); | |
$arFields['PROPERTIES'] = $res->GetProperties(); | |
//---------------------------------------------- | |
//SET ANY DATE | |
//$properties["LAST_EXECUTION"] = "07/25/2017"; | |
//---------------------------------------------- | |
//SET CURRENT LAST_EXECUTION AND LESS NUMBER DAY | |
$properties["LAST_EXECUTION"] = date("m/d/Y",strtotime("-5 day",strtotime($arFields["PROPERTY_LAST_EXECUTION_VALUE"]))); //SET -5 DAY FOR PAYSPAN | |
//---------------------------------------------- | |
//SET EMPTY FOR CLEAR FIELD | |
//$properties["LAST_EXECUTION"] = "" | |
//---------------------------------------------- | |
CIBlockElement::SetPropertyValuesEx($arFields['ID'], false, $properties); | |
//---------------------------------------------- | |
//VIEW FIELD LAST_EXECUTION | |
//echo ($arFields["PROPERTY_LAST_EXECUTION_VALUE"])."\n"; | |
//---------------------------------------------- | |
//VIEW ARRAY PROPERTIES ("ID","PROPERTY_LAST_EXECUTION",ETC) | |
var_dump($properties)."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment