Properties

$_guid

$_guid : 

GUID of the current object

Type

$_history

$_history : 

Cached revision history for the object

Type

Methods

update()

update(\midcom_core_dbaobject  $object, string  $updatemessage = null) : boolean

Save a new revision

Parameters

\midcom_core_dbaobject $object

the object to save.

string $updatemessage

the message to be saved with the object.

Returns

boolean —

true on success.

rcs_update()

rcs_update(object  $object, string  $message) : integer

Update object to RCS Should be called just before $object->update(), if the type parameter is omitted the function will use GUID to determine the type, this makes an extra DB query.

Parameters

object $object

to be updated.

string $message

Returns

integer —

: 0 on success 3 on missing object->guid nonzero on error in one of the commands.

get_revision()

get_revision(string  $revision) : array

Get the object of a revision

Parameters

string $revision

identifier of revision wanted

Returns

array —

array representation of the object

version_exists()

version_exists(string  $version) : boolean

Check if a revision exists

Parameters

string $version

Returns

boolean —

true if exists

get_prev_version()

get_prev_version(string  $version) : string

Get the previous versionID

Parameters

string $version

Returns

string —

versionid before this one or empty string.

get_previous_version()

get_previous_version(string  $version) : mixed

Mirror method for get_prev_version()

Parameters

string $version

Returns

mixed

get_next_version()

get_next_version(string  $version) : string

Get the next versionID

Parameters

string $version

Returns

string —

versionid before this one or empty string.

list_history_numeric()

list_history_numeric() : array

Return a list of the revisions as a key => value pair where the key is the index of the revision and the value is the revision id.

Order: revision 0 is the newest.

Returns

array

list_history()

list_history() : array

Lists the number of changes that has been done to the object

Returns

array —

list of changeids

get_diff()

get_diff(string  $oldest_revision, string  $latest_revision,   $renderer_style = 'inline') : array

Get a html diff between two versions.

Parameters

string $oldest_revision

id of the oldest revision

string $latest_revision

id of the latest revision

$renderer_style

Returns

array —

array with the original value, the new value and a diff -u

get_comment()

get_comment(string  $revision) : string

Get the comment of one revision.

Parameters

string $revision

id

Returns

string —

comment

restore_to_revision()

restore_to_revision(string  $revision) : boolean

Restore an object to a certain revision.

Parameters

string $revision

of revision to restore object to.

Returns

boolean —

true on success.

_generate_rcs_filename()

_generate_rcs_filename(  $guid) 

Parameters

$guid

rcs_parse_history_entry()

rcs_parse_history_entry(  $entry) 

Parameters

$entry

rcs_gethistory()

rcs_gethistory(string  $what) : array

Get a list of the object's history

Parameters

string $what

objectid (usually the guid)

Returns

array —

list of revisions and revision comment.

rcs_exec()

rcs_exec(string  $command, string  $filename) : string

execute a command

Parameters

string $command

The command to execute

string $filename

The file to operate on

Returns

string —

command result.

rcs_writefile()

rcs_writefile(  $guid,   $data) 

Writes $data to file $guid, does not return anything.

Parameters

$guid
$data

rcs_readfile()

rcs_readfile(string  $guid) : string

Reads data from file $guid and returns it.

Parameters

string $guid

Returns

string —

xml representation of guid

rcs_object2data()

rcs_object2data(\midcom_core_dbaobject  $object) : string

Make xml out of an object.

Parameters

\midcom_core_dbaobject $object

Returns

string —

xmldata

rcs_create()

rcs_create(object  $object, string  $description) : integer

Add object to RCS

Parameters

object $object

object to be saved

string $description

changelog comment.-

Returns

integer —

: 0 on success 3 on missing object->guid nonzero on error in one of the commands.

exec()

exec(  $command,   $use_rcs_bindir = true) 

Parameters

$command
$use_rcs_bindir