Documentation

Update

int
CBlogImage::Update(
 int   ID
 array arFields
);

The method updates image in a blog. Static method.

Method parameters

ParameterDescriptionAvailable from version
ID Modified image ID.
arFields Array of the array("field"=>"value") type.
  • ID - image ID;
  • FILE_ID - file ID;
  • BLOG_ID - blog ID;
  • POST_ID - blog post ID;
  • USER_ID - user ID;
  • TIMESTAMP_X - time when blog post is created;
  • TITLE - image title;
  • IMAGE_SIZE - image size in bytes;
  • IS_COMMENT - flag that specifies whether images is attached to a comment;
  • COMMENT_ID - ID of the comment to which the image is attached.

Returned value

The method returns ID of the modified image, if parameters were updated successfully. If an error occurs the method will return false, and exceptions will contain errors.

Examples of use

Modify TITLE for the image with identifier 14:

$res = CBlogImage::Update(
		14,
		array("TITLE" => "new image title")
	);

if($res)
	echo 'Success';


© «Bitrix24», 2001-2024
Up