Public Member Functions | Private Attributes
c_comdef_change Class Reference

A Class for Change Record Objects. More...

List of all members.

Public Member Functions

 UpdateToDB ()
 Updates or adds this instance to the database.
 DeleteFromDB ()
 Deletes this instance from the database.
 RestoreFromDB ()
 Updates this instance to the current values in the DB (replacing current values of the instance).
 __construct ($in_parent_obj, $in_change_type_enum, $in_user_id_int, $in_service_body_id_bigint, $in_before_string, $in_after_string, $in_object_class_string, $in_before_obj_id_bigint, $in_after_obj_id_bigint, $in_before_obj_lang_enum=null, $in_after_obj_lang_enum=null, $in_change_id_int=null, $in_change_name_string=null, $in_change_description_string=null, $in_lang_enum=null, $in_datetime_int=null)
 The initial setup call for the class. If you send in values, the object will set itself up to use them.
 GetObjectClass ()
 Accessor. Get the Object Class of this change record.
 GetID ()
 Accessor. Get the ID of this change record.
 GetChangeType ()
 Accessor. Get the type of this change record.
 GetUserID ()
 Accessor. Get the ID of the user that created this change record.
 GetServiceBodyID ()
 Accessor. Get the ID of the Service Body that was represented by the user that created this change record.
 GetBeforeObjectID ()
 Accessor. Return the ID of the "before" object.
 GetAfterObjectID ()
 Accessor. Return the ID of the "after" object.
 GetChangeDate ()
 Accessor. Return the date/time the change was made.
 GetBeforeSerialized ()
 Accessor. Return the before object in serialized form.
 GetAfterSerialized ()
 Accessor. Return the after object in serialized form.
 GetBeforeObject ($in_parent_object=null)
 Return the before object in object form.
 GetAfterObject ($in_parent_object=null)
 Return the after object in object form.
 Rollback ()
 Rolls the subject of this change to the "before" version.
 DescribeChange ()
 Return a string that describes the change.
 DetailedChangeDescription ()
 Return an array of strings that describes the change in a fairly detailed manner.

Private Attributes

 $change_id_bigint = null
 An integer, containing the unique ID of this change record.
 $before_object_string = null
 A serialized object (either c_comdef_format or c_comdef_meeting) before the change.
 $after_object_string = null
 The same object, serialized after the change.
 $before_object_id_bigint = null
 The ID of the Before Object.
 $after_object_id_bigint = null
 The ID of the After Object.
 $before_object_lang_enum = null
 The Language of the Before Object.
 $after_object_lang_enum = null
 The Language of the After Object.
 $change_user_int = null
 The ID of the user making the change.
 $change_service_body_int = null
 The ID of the Service Body on behalf of which the user is acting.
 $change_datetime_int = null
 The date and time (as a time() seconds value) when the change was made.
 $object_class_string = null
 The name of the object class that has been serialized.
 $change_type_enum = null

Detailed Description

A Class for Change Record Objects.

This class handles the Model for the way we record changes in the CoMDEF architecture. A change record has a record of who made the change, when it was made, notes on the change, and a "before" and "after" snapshot of the changed entity. Meetings, Users, Service bodies or formats can have changes recorded. If a new entity is created, the "before" is null. If an entity is deleted, then the "after" snapshot is null. Snapshots are serialized objects.


Constructor & Destructor Documentation

c_comdef_change::__construct ( in_parent_obj,
in_change_type_enum,
in_user_id_int,
in_service_body_id_bigint,
in_before_string,
in_after_string,
in_object_class_string,
in_before_obj_id_bigint,
in_after_obj_id_bigint,
in_before_obj_lang_enum = null,
in_after_obj_lang_enum = null,
in_change_id_int = null,
in_change_name_string = null,
in_change_description_string = null,
in_lang_enum = null,
in_datetime_int = null 
)

The initial setup call for the class. If you send in values, the object will set itself up to use them.

This is the server language.

This is the global language.

Should never be necessary.

If no languages are given for the input objects, we use the main language.

Parameters:
in_parent_objA reference to the parent object for this change object (usually an instance of c_comdef_changes)
in_change_type_enumEnum. The type of change. Can be:
  • 'comdef_change_type_new' - New object
  • 'comdef_change_type_delete' - Deleted the object
  • 'comdef_change_type_change' - Changed existing object
  • 'comdef_change_type_rollback' - Rolled existing object back to a previous version
in_user_id_intInteger. The ID of the user that made this change.
in_service_body_id_bigintInteger. The Service Body the user was acting for.
in_before_stringString (serialized object of either c_comdef_format or c_comdef_meeting). The object as it was immediately BEFORE the change.
in_after_stringString (serialized object of either c_comdef_format or c_comdef_meeting). The object as it was immediately AFTER the change.
in_object_class_stringA string, containing the class of the object[s] being passed in as serialized.
in_before_obj_id_bigintInteger, The ID of the Before Object.
in_after_obj_id_bigintInteger, The ID of the After Object.
in_before_obj_lang_enumEnum, the language of the Before Object.
in_after_obj_lang_enumEnum. The language of the After Object.
in_change_id_intInteger. The unique ID of this change record. If left null, the DB interaction will assign one.
in_change_name_stringString. A brief header (1-line description) of the change (optional).
in_change_description_stringString. A more detailed description of the change (optional).
in_lang_enumEnum. The language to record the change as. If null, the server or global language will be used.
in_datetime_intInteger containing the UNIX epoch (time() value) of the datetime the change was made. If null, the current time will be used.

Member Function Documentation

c_comdef_change::DeleteFromDB ( )

Deletes this instance from the database.

Exceptions:
aPDOException if there is a problem.

Implements i_comdef_db_stored.

c_comdef_change::DescribeChange ( )

Return a string that describes the change.

Returns:
a string array, describing the change, in fairly natural language.
c_comdef_change::DetailedChangeDescription ( )

Return an array of strings that describes the change in a fairly detailed manner.

Returns:
an associative array, containing an item-by-item change description. Null if no description.
  • 'overall' (required) Contains the same description as returned in DescribeChange()
  • 'details' (optional) Contains an array of individual change items.
c_comdef_change::GetAfterObject ( in_parent_object = null)

Return the after object in object form.

Returns:
a new c_comdef_meeting, c_comdef_user, c_comdef_service_body or c_comdef_format object. Null if failed or there is no object.
Parameters:
in_parent_objectA reference to the parent object for the new object. If null, the server will be used.
c_comdef_change::GetAfterObjectID ( )

Accessor. Return the ID of the "after" object.

Returns:
an integer.
c_comdef_change::GetAfterSerialized ( )

Accessor. Return the after object in serialized form.

Returns:
a binary string, containing the serialized data.
c_comdef_change::GetBeforeObject ( in_parent_object = null)

Return the before object in object form.

Returns:
a new c_comdef_meeting, c_comdef_user, c_comdef_service_body or c_comdef_format object. Null if failed or there is no object.
Parameters:
in_parent_objectA reference to the parent object for the new object. If null, the server will be used.
c_comdef_change::GetBeforeObjectID ( )

Accessor. Return the ID of the "before" object.

Returns:
an integer.
c_comdef_change::GetBeforeSerialized ( )

Accessor. Return the before object in serialized form.

Returns:
a binary string, containing the serialized data.
c_comdef_change::GetChangeDate ( )

Accessor. Return the date/time the change was made.

Returns:
an integer. The UNIX epoch time (time() return) of the change.
c_comdef_change::GetChangeType ( )

Accessor. Get the type of this change record.

Returns:
an enum. The type of change. Can be:
  • 'comdef_change_type_new' - New object
  • 'comdef_change_type_delete' - Deleted the object
  • 'comdef_change_type_change' - Changed existing object
  • 'comdef_change_type_rollback' - Rolled existing object back to a previous version
c_comdef_change::GetID ( )

Accessor. Get the ID of this change record.

Returns:
an integer. The ID of the change record.
c_comdef_change::GetObjectClass ( )

Accessor. Get the Object Class of this change record.

Returns:
a string. The object classname.
c_comdef_change::GetServiceBodyID ( )

Accessor. Get the ID of the Service Body that was represented by the user that created this change record.

Returns:
an integer. The ID of the Service Body.
c_comdef_change::GetUserID ( )

Accessor. Get the ID of the user that created this change record.

Returns:
an integer. The ID of the user.
c_comdef_change::RestoreFromDB ( )

Updates this instance to the current values in the DB (replacing current values of the instance).

Exceptions:
aPDOException if there is a problem.

Implements i_comdef_db_stored.

c_comdef_change::Rollback ( )

Rolls the subject of this change to the "before" version.

This will only work if there is a "before," and if the current user is cleared to edit both the before and current versions of the item.

Returns:
true, if successful. False, otherwise.
c_comdef_change::UpdateToDB ( )

Updates or adds this instance to the database.

Exceptions:
aPDOException if there is a problem.

Implements i_comdef_db_stored.


Member Data Documentation

c_comdef_change::$after_object_id_bigint = null [private]

The ID of the After Object.

c_comdef_change::$after_object_lang_enum = null [private]

The Language of the After Object.

c_comdef_change::$after_object_string = null [private]

The same object, serialized after the change.

c_comdef_change::$before_object_id_bigint = null [private]

The ID of the Before Object.

c_comdef_change::$before_object_lang_enum = null [private]

The Language of the Before Object.

c_comdef_change::$before_object_string = null [private]

A serialized object (either c_comdef_format or c_comdef_meeting) before the change.

c_comdef_change::$change_datetime_int = null [private]

The date and time (as a time() seconds value) when the change was made.

c_comdef_change::$change_id_bigint = null [private]

An integer, containing the unique ID of this change record.

c_comdef_change::$change_service_body_int = null [private]

The ID of the Service Body on behalf of which the user is acting.

c_comdef_change::$change_type_enum = null [private]

The type of change this was Can be:

  • 'comdef_change_type_new' - New object
  • 'comdef_change_type_delete' - Deleted the object
  • 'comdef_change_type_change' - Changed existing object
  • 'comdef_change_type_rollback' - Rolled existing object back to a previous version
c_comdef_change::$change_user_int = null [private]

The ID of the user making the change.

c_comdef_change::$object_class_string = null [private]

The name of the object class that has been serialized.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations