Public Member Functions | Static Public Member Functions | Private Attributes
c_comdef_service_body Class Reference

A Class for Service Body Objects. More...

List of all members.

Public Member Functions

 UpdateToDB ($is_rollback=false)
 Updates or adds this instance to the database.
 DeleteFromDB_NoRecord ()
 Deletes this instance from the database without creating a change record.
 DeleteFromDB ()
 Deletes this instance from the database, and creates a change record.
 RestoreFromDB ()
 Updates this instance to the current values in the DB (replacing current values of the instance).
 __construct ($in_parent_obj=null, $in_id_bigint=null, $in_principal_user_bigint=null, $in_editors_string=null, $in_kml_file_uri_string=null, $in_uri_string=null, $in_name_string=null, $in_description_string=null, $in_lang_enum=null, $in_world_id_mixed=null, $in_sb_type=null, $in_sb_owner=null, $in_sb_owner_2=null, $in_sb_meeting_email=null)
 The initial setup call for the class. If you send in values, the object will set itself up to use them.
 GetID ()
 Accessor - Returns the service body ID as an integer.
 SetID ($in_service_body_id_bigint)
 Accessor - Sets the service body ID as an integer.
 GetPrincipalUserID ()
 Accessor - Returns the principal user for this service body.
GetPrincipalUserObj ()
 Accessor - Returns the principal user for this service body.
 SetPrincipalUserID ($in_principal_user_id_bigint)
 Accessor - Sets the principal user for this service body.
 GetSBType ()
 Accessor - Returns the Service Body Type.
 SetSBType ($in_sb_type)
 Accessor - Sets the URI of the KML file for the Service Boundaries.
 GetOwnerID ()
 Accessor - Returns the ID of the 'owner' of this object.
 GetOwner2ID ()
 Accessor - Returns the ID of the 'secondary owner' of this object.
GetOwnerIDObject ()
 Accessor - Returns the 'owner' of this object as a reference to an object.
GetOwner2IDObject ()
 Accessor - Returns the 'secondary owner' of this object as a reference to an object.
 SetOwnerID ($in_sb_owner)
 Accessor - Sets the ID of the 'owner' of this object.
 SetOwner2ID ($in_sb_owner)
 Accessor - Sets the ID of the 'secondary owner' of this object.
 SetOwnerObj (&$in_sb_owner_obj)
 Accessor - Sets the ID of the 'owner' of this object by sending in an object reference.
 SetOwner2Obj (&$in_sb_owner_obj)
 Accessor - Sets the ID of the 'secondary owner' of this object by sending in an object reference.
 GetKMLURI ()
 Accessor - Returns the URI of the KML file for the Service Boundaries.
 SetKMLURI ($in_kml_uri_string)
 Accessor - Sets the URI of the KML file for the Service Boundaries.
 GetURI ()
 Accessor - Returns the URI of a site with more information on the Service Body.
 SetURI ($in_uri_string)
 Accessor - Sets the URI of a site with more information on the Service Body.
 SetContactEmail ($in_email)
 Accessor - set the contact email string.
 GetContactEmail ($in_recursive=false)
 Get the contact email for this Service Body. If $in_recursive is false, then it simply looks at this Service Body. This first looks at the Service Body Meeting Email. If that is not there, it gets the email for the principal admin. If that is not there, it percolates to the parent, recursively (if $in_recursive is true ).
 GetEditors ()
 Accessor - Returns IDs for all the editors.
 GetEditorsAsObjects ()
 Accessor - Returns user objects for all the editors.
 IsUserInServiceBody ($in_user_object=null)
 Accessor - Returns true if the current user is an editor for the Service Body, or if the user is an owner.
 IsUserInServiceBodyHierarchy ($in_user_object=null)
 Accessor - Returns true if the current user is an editor for the Service Body. Checks up the hierarchy recursively.
 SetEditors ($in_editor_id_array)
 Accessor - Sets the editors by ID.
 SerializeObject ()
 Returns a storable serialization of the object, as a string.
 UserCanEdit ($in_user_object=null)
 Test to see if a user is allowed to edit an instance (change the data). Service Body Administrators that are Editors in parent, or secondary parent Service bodies can edit the Service body.
 IsOwnedBy ($in_sb_id, $in_direct=false)
 Check to see if a given Service Body ID is anywhere in the "direct parent" hierarchy of this Service Body.

Static Public Member Functions

static UnserializeObject ($in_parent, $serialized_string)
 This takes the serialized table, and instantiates a new object from it.

Private Attributes

 $_id_bigint = null
 An integer, containing the unique ID of this service body.
 $_principal_user_bigint = null
 An integer, with the ID of the principal administrator for this Service Body.
 $_editors_string = null
 A string, containing a CSV list of integers, each an ID for a user that has editor privileges for meetings for this Service Body.
 $_kml_file_uri_string = null
 A string, containing a URI to a KML file with Service Boundaries for the Service Body.
 $_uri_string = null
 A string, containing a URI to a site that gives further information about the Service Body.
 $_sb_type = null
 $_sb_owner = null
 An integer. The ID of the Service Body that "owns" this one.
 $_sb_owner_2 = null
 An integer. Some Service Bodies can have "unofficial" "owners" (like Zonal Forums or Metro Areas).
 $_sb_meeting_email = null
 A string that contains the meeting contact email address.

Detailed Description

A Class for Service Body Objects.

The BMLT doesn't really care that much about the Service role of any given Service Body. Indicators of such are provided so that clients of the BMLT can keep track of them.

The BMLT is more interested in the hierarchy of a Service Body. If a Service Body has an owner or a secondary owner, then any member of the owner or secondary owner can edit any meetings in the Service Body, and and Service Body Administrators in an owner or secondary owner can administer the Service Body itself.


Constructor & Destructor Documentation

c_comdef_service_body::__construct ( in_parent_obj = null,
in_id_bigint = null,
in_principal_user_bigint = null,
in_editors_string = null,
in_kml_file_uri_string = null,
in_uri_string = null,
in_name_string = null,
in_description_string = null,
in_lang_enum = null,
in_world_id_mixed = null,
in_sb_type = null,
in_sb_owner = null,
in_sb_owner_2 = null,
in_sb_meeting_email = 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.

Should never be necessary.

Parameters:
in_parent_objA reference to the parent object for this Service Body Object.
in_id_bigintAn integer, containing the ID of the object. If null or 0, then the object is new.
in_principal_user_bigintAn integer with the ID of the principal user for this Service Body.
in_editors_stringA string containing a CSV array of integers with editor user IDs
in_kml_file_uri_stringA string containing a URI to the KML file that displays this Service Body's boundaries.
in_uri_stringA string containing a URI to a site that has more information about the Service Body.
in_name_stringThe local name of the Service Body as a string.
in_description_stringThe local description of the Service Body as a string.
in_lang_enumA string, with the language code for this Service Body.
in_world_id_mixedA string, containing the World ID for this Service Body.
in_sb_typeAn enum string, containing the Service Body type. It can be one of the following:
  • c_comdef_service_body__GRP__ Individual NA Group
  • c_comdef_service_body__ASC__ Area Service Committee
  • c_comdef_service_body__RSC__ Regional Service Committee
  • c_comdef_service_body__WSC__ World Service Committee
  • c_comdef_service_body__MAS__ Metro Area
  • c_comdef_service_body__ZFM__ Zonal Forum
in_sb_ownerAn integer. The ID of the Service Body that "owns" this Service Body.
in_sb_owner_2An integer. The ID of the "secondary" Service Body that "owns" this Service Body.
in_sb_meeting_emailA string, containing any email address that is to be used for meeting contacts.

Member Function Documentation

c_comdef_service_body::DeleteFromDB ( )

Deletes this instance from the database, and creates a change record.

Returns:
true if successful, false, otherwise.
Exceptions:
aPDOException if there is a problem.

Implements i_comdef_db_stored.

c_comdef_service_body::DeleteFromDB_NoRecord ( )

Deletes this instance from the database without creating a change record.

Returns:
true if successful, false, otherwise.
Exceptions:
aPDOException if there is a problem.
c_comdef_service_body::GetContactEmail ( in_recursive = false)

Get the contact email for this Service Body. If $in_recursive is false, then it simply looks at this Service Body. This first looks at the Service Body Meeting Email. If that is not there, it gets the email for the principal admin. If that is not there, it percolates to the parent, recursively (if $in_recursive is true ).

Returns:
a string, which is the contact email for this Service Body
Parameters:
in_recursiveIf this is true, then the function will return a recursive result. Default is false.
c_comdef_service_body::GetEditors ( )

Accessor - Returns IDs for all the editors.

Returns:
an array of integers, containing the editor IDs.
c_comdef_service_body::GetEditorsAsObjects ( )

Accessor - Returns user objects for all the editors.

Returns:
an array of references to c_comdef_user objects. The associative key for each user will the ID for that user.
c_comdef_service_body::GetID ( )

Accessor - Returns the service body ID as an integer.

Returns:
an integer, containing the service body ID.
c_comdef_service_body::GetKMLURI ( )

Accessor - Returns the URI of the KML file for the Service Boundaries.

Returns:
a string, containing the URI.
c_comdef_service_body::GetOwner2ID ( )

Accessor - Returns the ID of the 'secondary owner' of this object.

Returns:
an integer, containing the owner ID of the secondary "owner."
& c_comdef_service_body::GetOwner2IDObject ( )

Accessor - Returns the 'secondary owner' of this object as a reference to an object.

Returns:
a reference to the internal c_comdef_service_body object for the service body. Null if not found.
c_comdef_service_body::GetOwnerID ( )

Accessor - Returns the ID of the 'owner' of this object.

Returns:
an integer, containing the owner ID.
& c_comdef_service_body::GetOwnerIDObject ( )

Accessor - Returns the 'owner' of this object as a reference to an object.

Returns:
a reference to the internal c_comdef_service_body object for the service body. Null if not found.
c_comdef_service_body::GetPrincipalUserID ( )

Accessor - Returns the principal user for this service body.

Returns:
an integer, containing the user ID.
& c_comdef_service_body::GetPrincipalUserObj ( )

Accessor - Returns the principal user for this service body.

Returns:
a reference to a c_comdef_user object of the principal user.
c_comdef_service_body::GetSBType ( )

Accessor - Returns the Service Body Type.

Returns:
a string, containing the Type. It can be one of the following:
  • c_comdef_service_body__GRP__ Individual NA Group
  • c_comdef_service_body__ASC__ Area Service Committee
  • c_comdef_service_body__RSC__ Regional Service Committee
  • c_comdef_service_body__WSC__ World Service Committee
  • c_comdef_service_body__MAS__ Metro Area
  • c_comdef_service_body__ZFM__ Zonal Forum
c_comdef_service_body::GetURI ( )

Accessor - Returns the URI of a site with more information on the Service Body.

Returns:
a string, containing the URI.
c_comdef_service_body::IsOwnedBy ( in_sb_id,
in_direct = false 
)

Check to see if a given Service Body ID is anywhere in the "direct parent" hierarchy of this Service Body.

Returns:
a boolean. True if the given Service Body appears in the hierarchy above it.
Parameters:
in_sb_idThe ID of a potential owner.
in_directIf this is set to true, then only the immediate parent is checked. Default is false.
c_comdef_service_body::IsUserInServiceBody ( in_user_object = null)

Accessor - Returns true if the current user is an editor for the Service Body, or if the user is an owner.

Returns:
a boolean. True if the user is an editor or principal user.
Parameters:
in_user_objectA reference to an instance of c_comdef_user. If null, the current user is checked.
c_comdef_service_body::IsUserInServiceBodyHierarchy ( in_user_object = null)

Accessor - Returns true if the current user is an editor for the Service Body. Checks up the hierarchy recursively.

Returns:
a boolean. True if the user is in the hierarchy (going up) of the Service Body.
Parameters:
in_user_objectA reference to an instance of c_comdef_user. If null, the current user is checked.
c_comdef_service_body::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_service_body::SerializeObject ( )

Returns a storable serialization of the object, as a string.

This is only used for the changes, as the serialized string may not be easily searched.

Returns:
a string, containing the table array, in serialized form.

Implements i_comdef_serialized.

c_comdef_service_body::SetContactEmail ( in_email)

Accessor - set the contact email string.

Parameters:
in_emailA string. The email address to be set.
c_comdef_service_body::SetEditors ( in_editor_id_array)

Accessor - Sets the editors by ID.

Returns:
the processed string.
Parameters:
in_editor_id_arrayAn array of integers, containing the user IDs.
c_comdef_service_body::SetID ( in_service_body_id_bigint)

Accessor - Sets the service body ID as an integer.

Parameters:
in_service_body_id_bigintAn integer, with the service body ID.
c_comdef_service_body::SetKMLURI ( in_kml_uri_string)

Accessor - Sets the URI of the KML file for the Service Boundaries.

Parameters:
in_kml_uri_stringA string, containing the URI
c_comdef_service_body::SetOwner2ID ( in_sb_owner)

Accessor - Sets the ID of the 'secondary owner' of this object.

Parameters:
in_sb_ownerAn integer, containing the owner of the object.
c_comdef_service_body::SetOwner2Obj ( &$  in_sb_owner_obj)

Accessor - Sets the ID of the 'secondary owner' of this object by sending in an object reference.

This will test, to ensure that a loop will not occur. The function will return false if it determines that the hierarchy would result in this object being its own ancestor.

Returns:
true, if successful, false, if the ID would cause a loop.
Parameters:
in_sb_owner_objAn integer, containing the secondary owner of the object.
c_comdef_service_body::SetOwnerID ( in_sb_owner)

Accessor - Sets the ID of the 'owner' of this object.

Parameters:
in_sb_ownerAn integer, containing the owner of the object.
c_comdef_service_body::SetOwnerObj ( &$  in_sb_owner_obj)

Accessor - Sets the ID of the 'owner' of this object by sending in an object reference.

This will test, to ensure that a loop will not occur. The function will return false if it determines that the hierarchy would result in this object being its own ancestor.

Returns:
true, if successful, false, if the ID would cause a loop.
Parameters:
in_sb_owner_objAn integer, containing the owner of the object.
c_comdef_service_body::SetPrincipalUserID ( in_principal_user_id_bigint)

Accessor - Sets the principal user for this service body.

Parameters:
in_principal_user_id_bigintInteger, the principal user ID.
c_comdef_service_body::SetSBType ( in_sb_type)

Accessor - Sets the URI of the KML file for the Service Boundaries.

Parameters:
in_sb_typeA string, containing the Type It can be one of the following:
  • c_comdef_service_body__GRP__ Individual NA Group
  • c_comdef_service_body__ASC__ Area Service Committee
  • c_comdef_service_body__RSC__ Regional Service Committee
  • c_comdef_service_body__WSC__ World Service Committee
  • c_comdef_service_body__MAS__ Metro Area
  • c_comdef_service_body__ZFM__ Zonal Forum
c_comdef_service_body::SetURI ( in_uri_string)

Accessor - Sets the URI of a site with more information on the Service Body.

Parameters:
in_uri_stringA string, containing the URI
static c_comdef_service_body::UnserializeObject ( in_parent,
serialized_string 
) [static]

This takes the serialized table, and instantiates a new object from it.

Returns:
a new instance of c_comdef_service_body, set up according to the serialized data passed in.
Parameters:
in_parentThe parent object.
serialized_stringA string containing the serialized data.

Implements i_comdef_serialized.

c_comdef_service_body::UpdateToDB ( is_rollback = false)

Updates or adds this instance to the database.

Returns:
true if successful, false, otherwise.
Exceptions:
aPDOException if there is a problem.
Parameters:
is_rollbackIf true, this is a rollback operation.
c_comdef_service_body::UserCanEdit ( in_user_object = null)

Test to see if a user is allowed to edit an instance (change the data). Service Body Administrators that are Editors in parent, or secondary parent Service bodies can edit the Service body.

Returns:
true, if the user is allowed to edit, false, otherwise.
Parameters:
in_user_objectA reference to a c_comdef_user object, for the user to be validated. If null, or not supplied, the server current user is tested.

Implements i_comdef_auth.


Member Data Documentation

c_comdef_service_body::$_editors_string = null [private]

A string, containing a CSV list of integers, each an ID for a user that has editor privileges for meetings for this Service Body.

c_comdef_service_body::$_id_bigint = null [private]

An integer, containing the unique ID of this service body.

c_comdef_service_body::$_kml_file_uri_string = null [private]

A string, containing a URI to a KML file with Service Boundaries for the Service Body.

c_comdef_service_body::$_principal_user_bigint = null [private]

An integer, with the ID of the principal administrator for this Service Body.

c_comdef_service_body::$_sb_meeting_email = null [private]

A string that contains the meeting contact email address.

c_comdef_service_body::$_sb_owner = null [private]

An integer. The ID of the Service Body that "owns" this one.

c_comdef_service_body::$_sb_owner_2 = null [private]

An integer. Some Service Bodies can have "unofficial" "owners" (like Zonal Forums or Metro Areas).

c_comdef_service_body::$_sb_type = null [private]

An enum string, containing the Service Body type. It can be one of the following:

  • c_comdef_service_body__GRP__ Individual NA Group
  • c_comdef_service_body__ASC__ Area Service Committee
  • c_comdef_service_body__RSC__ Regional Service Committee
  • c_comdef_service_body__WSC__ World Service Committee
  • c_comdef_service_body__MAS__ Metro Area
  • c_comdef_service_body__ZFM__ Zonal Forum
c_comdef_service_body::$_uri_string = null [private]

A string, containing a URI to a site that gives further information about the Service Body.


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