A Class for Service Body Objects. More...
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. | |
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.
| 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.
| in_parent_obj | A reference to the parent object for this Service Body Object. |
| in_id_bigint | An integer, containing the ID of the object. If null or 0, then the object is new. |
| in_principal_user_bigint | An integer with the ID of the principal user for this Service Body. |
| in_editors_string | A string containing a CSV array of integers with editor user IDs |
| in_kml_file_uri_string | A string containing a URI to the KML file that displays this Service Body's boundaries. |
| in_uri_string | A string containing a URI to a site that has more information about the Service Body. |
| in_name_string | The local name of the Service Body as a string. |
| in_description_string | The local description of the Service Body as a string. |
| in_lang_enum | A string, with the language code for this Service Body. |
| in_world_id_mixed | A string, containing the World ID for this Service Body. |
| in_sb_type | An enum string, containing the Service Body type. It can be one of the following:
|
| in_sb_owner | An integer. The ID of the Service Body that "owns" this Service Body. |
| in_sb_owner_2 | An integer. The ID of the "secondary" Service Body that "owns" this Service Body. |
| in_sb_meeting_email | A string, containing any email address that is to be used for meeting contacts. |
| c_comdef_service_body::DeleteFromDB | ( | ) |
Deletes this instance from the database, and creates a change record.
| a | PDOException 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.
| a | PDOException 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 ).
| in_recursive | If 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.
| c_comdef_service_body::GetEditorsAsObjects | ( | ) |
Accessor - Returns user objects for all the editors.
| c_comdef_service_body::GetID | ( | ) |
Accessor - Returns the service body ID as an integer.
| c_comdef_service_body::GetKMLURI | ( | ) |
Accessor - Returns the URI of the KML file for the Service Boundaries.
| c_comdef_service_body::GetOwner2ID | ( | ) |
Accessor - Returns the ID of the 'secondary owner' of this object.
| & c_comdef_service_body::GetOwner2IDObject | ( | ) |
Accessor - Returns the 'secondary owner' of this object as a reference to an object.
| c_comdef_service_body::GetOwnerID | ( | ) |
Accessor - Returns the ID of the 'owner' of this object.
| & c_comdef_service_body::GetOwnerIDObject | ( | ) |
Accessor - Returns the 'owner' of this object as a reference to an object.
| c_comdef_service_body::GetPrincipalUserID | ( | ) |
Accessor - Returns the principal user for this service body.
| & c_comdef_service_body::GetPrincipalUserObj | ( | ) |
Accessor - Returns the principal user for this service body.
| c_comdef_service_body::GetSBType | ( | ) |
Accessor - Returns the Service Body Type.
| c_comdef_service_body::GetURI | ( | ) |
Accessor - Returns the URI of a site with more information on the Service Body.
| 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.
| in_sb_id | The ID of a potential owner. |
| in_direct | If 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.
| in_user_object | A 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.
| in_user_object | A 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).
| a | PDOException 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.
Implements i_comdef_serialized.
| c_comdef_service_body::SetContactEmail | ( | $ | in_email | ) |
Accessor - set the contact email string.
| in_email | A string. The email address to be set. |
| c_comdef_service_body::SetEditors | ( | $ | in_editor_id_array | ) |
Accessor - Sets the editors by ID.
| in_editor_id_array | An 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.
| in_service_body_id_bigint | An 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.
| in_kml_uri_string | A string, containing the URI |
| c_comdef_service_body::SetOwner2ID | ( | $ | in_sb_owner | ) |
Accessor - Sets the ID of the 'secondary owner' of this object.
| in_sb_owner | An 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.
| in_sb_owner_obj | An 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.
| in_sb_owner | An 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.
| in_sb_owner_obj | An 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.
| in_principal_user_id_bigint | Integer, the principal user ID. |
| c_comdef_service_body::SetSBType | ( | $ | in_sb_type | ) |
Accessor - Sets the URI of the KML file for the Service Boundaries.
| in_sb_type | A string, containing the Type It can be one of the following:
|
| c_comdef_service_body::SetURI | ( | $ | in_uri_string | ) |
Accessor - Sets the URI of a site with more information on the Service Body.
| in_uri_string | A 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.
| in_parent | The parent object. |
| serialized_string | A 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.
| a | PDOException if there is a problem. |
| is_rollback | If 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.
| in_user_object | A 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.
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::$_uri_string = null [private] |
A string, containing a URI to a site that gives further information about the Service Body.
1.7.4