Bitrix Site Manager

CPosting::Update

CPosting::Update(
 $ID,
 $arFields
);

The method Update updates the issue properties by its ID.

Parameters

ParameterDescription
$ID The issue ID.
$arFields Associated array containing the keys and values of the Issue object fields. The following fields can also be used:
  • RUB_ID - array of the mailing list ID's;
  • GROUP_ID - array of the user group ID's.

Return Values

Returns true on success. In case of an error, it returns false and the class variable LAST_ERROR contains the error description.

Example



$posting = new CPosting;
$arFields = Array(
    "FROM_FIELD" => $FROM_FIELD,
    "TO_FIELD" => $TO_FIELD,
    "BCC_FIELD" => $BCC_FIELD,
    "EMAIL_FILTER" => $EMAIL_FILTER,
    "SUBJECT" => $SUBJECT,
    "BODY_TYPE" => ($BODY_TYPE <> "html"? "text":"html"),
    "BODY" => $BODY,
    "DIRECT_SEND" => ($DIRECT_SEND <> "Y"? "N":"Y"),
    "CHARSET" => $CHARSET,
    "SUBSCR_FORMAT" => ($SUBSCR_FORMAT<>"html" && 
                        $SUBSCR_FORMAT<>"text" 
                            ? false : $SUBSCR_FORMAT), 
    "RUB_ID" => $RUB_ID,
    "GROUP_ID" => $GROUP_ID
);
if($STATUS <> "")
{
    if($STATUS<>"S" && $STATUS<>"E" && $STATUS<>"P")
        $STATUS = "D";
    $arFields["STATUS"] = $STATUS;
    if($STATUS == "D")
    {
        $arFields["DATE_SENT"] = false;
        $arFields["SENT_BCC"] = "";
        $arFields["ERROR_EMAIL"] = "";
    }
}
if(!$posting->Update($ID, $arFields))
    $strError = $posting->LAST_ERROR;