UNB Components Code Reference

UnbMessageRevision::CreateCopy method

Creates a new message revision instance for a message, based on this revision.

public function UnbMessageRevision::CreateCopy ($subject, $content, $summary, $contentType, $data, $dataFileName, $writeToFile, $draft = false, $removeFileIds = null);

Parameters

subject

(string) Subject of the new message revision, true to copy or null (max. 255 characters)

content

(string) Content of the new message revision, true to copy or null (max. 16,777,215 characters)

summary

(string) Summary of the changes in the new revision to the previous one or null (max. 255 characters)

contentType

(string) MIME content type of attached file data, true to copy or null (max. 255 characters)

data

(string) Attached file data contents, true to copy or null

dataFileName

(string) Local file name for attached file data or null (do not use together with data)

writeToFile

(bool) Write the attached file data into a file instead of the database or null for automatic decision

draft  –  optional, default: false

(bool) Declare the new message revision as draft

removeFileIds  –  optional, default: null

(array(int)) Message IDs of the assigned files to remove from the copied revision

Return value

The newly created UnbMessageRevision object, if successful, null otherwise.

Remarks

The newly created message revision instance is also stored in the database. The same conditions as for the static Create method apply. The data for one or multiple fields of the new message revision can be copied from this revision by setting the respective argument to true. All tags are copied from this revision to the new one.

This message revision must have been retrieved with content level UnbMessageRevisionContentLevel::Content.

Exceptions thrown

InvalidArgumentException No description available.
LengthException No description available.
Exception 

If the input file could not be read or copied.

UnbSecurityException 

If not logged in or no read/alter access on the message.

UnbDatabaseException No description available.

Privileges required

Must be logged in and need read and alter access on the message

Member of class: UnbMessageRevision

Implementation file: messagerevision.class.php, line 380

© 2011 Yves Goergen. UNB Components Homepage. Reference generated on 2011-02-22.