This class is the main server class. It instantiates a PDO database object, and is the starting point for everything done and managed by the CoMDEF server system. More...
Public Member Functions | |
| __construct () | |
| The initial setup call for the class. Part of setting up the server is establishing the database connection, and reading in all of the formats, which will be available in the GetFormatsObj() member function afterwards. | |
| Initialize () | |
| This reads the Formats, Meeting and Service Entity IDs. | |
| GetLocalLang () | |
| Returns the Server Local Language. | |
| ReadFormats () | |
| This is an internal function that reads in all of the stored formats, in all provided languages, and instantiates local objects for them. Access them with the GetFormatsObj() member function afterwards. | |
| ReadUsers () | |
| This is an internal function that reads in all of the stored users and instantiates local objects for them. Access them with the GetUsersObj() member function afterwards. | |
| ReadServiceBodies () | |
| This is an internal function that reads in all of the stored service bodies and instantiates local objects for them. Access them with the GetServiceObj() member function afterwards. | |
| ReadServiceIDs () | |
| This gathers the IDs of all the Service bodies that appear in meeting records. It is NOT a dump of the Service Bodies table. | |
| & | GetServiceBodyArray () |
| Simply returns a reference to the contained Service Body array. | |
| GetServiceBodyArrayHierarchical () | |
| Returns the Service Body objects in a nested, hierarchical array, with "parents" containing "children.". | |
| GetNestedServiceBodyArray ($in_id=0) | |
| This reads the Service bodies in hierarchical order, and returns them in a multi-dimensional array that reflects the hierarchy. | |
| GetFormatsObj () | |
| Simply returns a reference to the formats container. | |
| & | GetServiceIDs () |
| Simply returns the stored service IDs. | |
| & | GetAllServiceIDs () |
| Simply returns the stored service IDs for ALL Service Bodies. | |
| GetChangesFromSQL ($in_sql, $in_value_array=null) | |
| Given an SQL statement and a value array (for DBO prepared statements), return a new c_comdef_changes object, loaded with the instances of the changes that were returned from the query. | |
Static Public Member Functions | |
| static | MakeServer () |
| This is the factory for the server instantiation. It makes sure that only one instance exists. | |
| static | GetServer () |
| static | SetServer ($in_server_instance) |
| Sets the server instance. | |
| static | DuplicateMeetingID ($in_meeting_id) |
| This creates a new meeting that is an exact duplicate of the object for the meeting whose ID is passed in. The new meeting has a new ID, and is unpublished. | |
| static | DuplicateMeetingObj ($in_meeting_obj) |
| This creates a new meeting that is an exact duplicate of the object passed in. The new meeting has a new ID, and is unpublished. | |
| static | GetNewMeetingID () |
| Gets an unused ID from the end of the table and returns it. It also sets that ID into the table AUTO_INCREMENT, so it can't get re-used. | |
| static | AddNewMeeting ($in_service_body_bigint, $in_weekday_tinyint, $in_start_time_int, $in_lang_enum) |
| Creates a new, relatively empty meeting in the database, with no data fields and minimal information. | |
| static | AddNewServiceBody ($in_name_string, $in_lang_enum, $in_principal_user_bigint, $in_description_string=null, $in_editors_string=null, $in_uri_string=null, $in_kml_uri_string=null, $in_worldid_mixed=null, $in_sb_type=null, $in_sb_owner=null) |
| Creates a new Service Body in the Database. | |
| static | AddNewUser ($in_user_login, $in_user_unencrypted_password, $in_user_level, $in_user_email, $in_name_string=null, $in_description_string=null, $in_lang_enum=null) |
| Creates a new user in the Database. | |
| static | TrimChanges ($in_type, $in_id) |
| trims the changes for the given item. | |
| static | AddNewChange ($in_user_id_bigint, $in_change_type, $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_name_string=null, $in_description_string=null, $in_lang_enum=null) |
| Creates a new change record in the Database. | |
| static | GetNamespace () |
| Simply returns the namespace of this server. | |
| static | GetFormatTableName_obj () |
| Simply returns the name of the format table. | |
| static | GetMeetingTableName_obj () |
| Simply returns the name of the meetings table. | |
| static | GetChangesTableName_obj () |
| Simply returns the name of the changes table. | |
| static | GetServiceBodiesTableName_obj () |
| Simply returns the name of the service bodies table. | |
| static | GetUserTableName_obj () |
| Simply returns the name of the user table. | |
| static & | GetServerLangs () |
| Get the local readable string for the server languages. | |
| static & | GetServerUsersObj () |
| Get the object list for the server's registered users. | |
| static & | GetUserByIDObj ($in_user_id_bigint) |
| Get the object for a single user, given an ID. | |
| static & | GetUserByLoginCredentials ($in_login, $in_password) |
| Given a login and password, looks up the user, and returns a reference to that user object. | |
| static & | GetCurrentUserObj ($in_is_ajax=false) |
| Get the current logged-in user, as a c_comdef_user instance. | |
| static | IsUserServerAdmin ($in_user_obj=null, $in_is_ajax=false) |
| Find out if the user is a server admin. | |
| static | GetEncryptedPW ($in_login, $in_password) |
| Given a login and password, looks up the user, and returns an encrypted password for that user. | |
| static & | GetUsersByLevelObj ($in_user_level_bigint, $in_or_higher=false, $in_include_disabled=false) |
| Get the objects for all users of a certain user level. | |
| static & | GetServiceBodyByIDObj ($in_service_body_id_bigint) |
| Get the object for a single service body, given an ID. | |
| static | IsFormatKeyUnique ($in_key_string, $in_lang_enum) |
| Given an ID and a language for a format, as well as a code, returns true if the code does NOT appear in the DB. | |
| static | GetOneFormat ($in_id_bigint, $in_lang_enum) |
| Given an ID and a language for a format, it returns one instance. | |
| static | DoesMeetingExist ($in_id_bigint) |
| Given an ID for a meeting, it returns true if the meeting currently exists. | |
| static | GetOneMeeting ($in_id_bigint, $test_only=false) |
| Given an ID for a meeting, it returns one instance. | |
| static | GetOneChange ($in_id_bigint) |
| Given an ID for a change, it returns one instance. | |
| static | GetOneUser ($in_id_bigint) |
| Given an ID for a user, it returns one instance. | |
| static | GetMeetingsByID ($in_id_bigint_array) |
| Get a series of meetings, each identified by an ID. This does not filter by any of the other major criteria. It is designed to facilitate direct access to meeting objects. | |
| static | GetMeetings ($in_service_body_id_bigint_array=null, $in_lang_filter_array=null, $in_weekday_tinyint_array=null, $in_formats=null, $in_start_after=null, $in_start_before=null, $in_min_duration=null, $in_max_duration=null, $in_search_rect_array=null, $in_first=null, &$in_num=null, $in_published=0) |
| Given a set of one or more main criteria, returns a new c_comdef_meetings object with instances of those meetings, loaded from the database. | |
| static | GetMeetingsForAServiceBody ($in_sb_id) |
| Returns a c_comdef_meetings_object, containing all the meetings directly "owned" by the Service Body whose ID is submitted. | |
| static | GetChangesFromIDAndType ($in_type, $in_id=null, $in_start_date=null, $in_end_date=null) |
| Gets a list of all change objects of a certain type, or only one, if the change affects a certain class, and an ID is given for that class (not the change ID -the ID of the changed object). | |
| static | GetChangesFromOTypeAndCType ($in_o_type, $in_change_type) |
| This function allows you to get a list of changes by object type, and change type (such as all deleted meetings, or all rolled-back formats). | |
| static | getKmPerLonAtLat ($dLatitude) |
| static | GetSquareForRadius ($in_radius, $in_long_in_degrees, $in_lat_in_degrees) |
| This is a static utility function that takes a specified radius and center point and calculates a square, in longitude and latitude points, that encompasses that radius. This greatly narrows the scope of the search, so the radius calculation will simply eliminate any meetings that are "in the corners.". | |
| static | GetRadiusSQL ($in_search_rect_array) |
| Return SQL for the given coordinates. | |
| static | HuntForRadius ($in_search_result_count, $in_long_in_degrees, $in_lat_in_degrees, $in_weekday_tinyint_array) |
| Find the smallest radius that contains at least the given number of meetings. The way this works is that the center is set, and the optimal radius is selected in kilometers to deliver that many meetings. The radius starts at 25 Km (about 10 miles), and goes up or down in 5Km "clicks." Under 5Km, it reduces to 0.5Km "clicks." It will not go out more than 100Km. | |
| static | GetLocalStrings ($in_lang_enum=null) |
| This gets the appropriate language files, and puts all the the strings into an associative array. If a language enum is passed in, and the language directory exists, then the strings are loaded from that directory. If nothing is passed in, the first place we look is in the HTTP query, to see if a 'lang_enum' query is present. If it is there, we use that. If not, we use the base server language. | |
| static | GetUserServiceBodies ($in_user_id=null) |
| Return all the Service Bodies this user is authorized with. | |
Static Public Attributes | |
| static | $server_instance = null |
| This is the SINGLETON server instance. There can only be one... | |
| static | $server_local_strings = null |
| This contains a cache of the local strings. | |
Static Private Member Functions | |
| static | ParseMeetingsByFormats ($in_meetings, $in_formats) |
| This is an alternative to the MySQL REGEXP test. It will go through all the meetings returned by a broad query, and remove any that do not contain all of the given formats. | |
| static | GetMeetingsFromSQL ($in_sql, $in_value_array=null) |
| Given an SQL statement and a value array (for PDO prepared statements), return a new c_comdef_meetings object, loaded with the instances of the meetings that were returned from the query. | |
Private Attributes | |
| $_format_table_name = null | |
| This is the name of the Formats table in the database. | |
| $_meeting_table_name = null | |
| This is the name of the Meetings table in the database. | |
| $_changes_table_name = null | |
| This is the name of the Changes table in the database. | |
| $_user_table_name = null | |
| This is the name of the user table in the database. | |
| $_service_bodies_table_name = null | |
| This is the name of the Service Bodies table in the database. | |
| $_formats_obj = null | |
| This is the container for the loaded formats. | |
| $_users_obj = null | |
| This is the container for the loaded users. | |
| $_service_ids = null | |
| This has the IDs of all the Service entities that "own" meetings on the server. | |
| $_server_lang_names = null | |
| This contains the names of the server languages, in their languages. It is an associative array, based on the language enums. | |
| $_server_namespace = null | |
| This contains the server namespace, which is used to uniquely identify data from this server. The default is the server URI, with "/CoMDEF" appended. | |
| $_service_obj_array = null | |
| This contains the actual Service Body objects as a simple array. | |
This class is the main server class. It instantiates a PDO database object, and is the starting point for everything done and managed by the CoMDEF server system.
| c_comdef_server::__construct | ( | ) |
The initial setup call for the class. Part of setting up the server is establishing the database connection, and reading in all of the formats, which will be available in the GetFormatsObj() member function afterwards.
| static c_comdef_server::AddNewChange | ( | $ | in_user_id_bigint, |
| $ | in_change_type, | ||
| $ | 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_name_string = null, |
||
| $ | in_description_string = null, |
||
| $ | in_lang_enum = null |
||
| ) | [static] |
Creates a new change record in the Database.
| in_user_id_bigint | Integer. The ID of the user making the change. |
| in_change_type | Enum. The type of change. Can be:
|
| in_service_body_id_bigint | Integer. The ID of the Service body for which the user was acting. |
| in_before_string | Serialized object string. The "before" object, in serialized form. |
| in_after_string | Serialized object string. The "after" object, in serialized form. |
| in_object_class_string | The class of the objects. |
| in_before_obj_id_bigint | Integer, The ID of the Before Object. |
| in_after_obj_id_bigint | Integer, The ID of the After Object. |
| in_before_obj_lang_enum | Enum, the language of the Before Object. |
| in_after_obj_lang_enum | Enum. The language of the After Object. |
| in_name_string | The change's Name (Optional) |
| in_description_string | The description of the change (Optional) |
| in_lang_enum | The language for the change (Optional -If not supplied, the server default will be used) |
Referenced by c_comdef_user::DeleteFromDB(), c_comdef_service_body::DeleteFromDB(), c_comdef_meeting::DeleteFromDB(), c_comdef_format::DeleteFromDB(), c_comdef_user::UpdateToDB(), c_comdef_service_body::UpdateToDB(), c_comdef_meeting::UpdateToDB(), and c_comdef_format::UpdateToDB().
| static c_comdef_server::AddNewMeeting | ( | $ | in_service_body_bigint, |
| $ | in_weekday_tinyint, | ||
| $ | in_start_time_int, | ||
| $ | in_lang_enum | ||
| ) | [static] |
Creates a new, relatively empty meeting in the database, with no data fields and minimal information.
| in_service_body_bigint | The ID of the Service Body that "owns" this meeting. |
| in_weekday_tinyint | The index of the weekday on which the meeting is held (0 = Sunday, 6 = Saturday). |
| in_start_time_int | The time, in standard PHP Epoch time, at which the meeting starts. |
| in_lang_enum | The language for the meeting. |
| static c_comdef_server::AddNewServiceBody | ( | $ | in_name_string, |
| $ | in_lang_enum, | ||
| $ | in_principal_user_bigint, | ||
| $ | in_description_string = null, |
||
| $ | in_editors_string = null, |
||
| $ | in_uri_string = null, |
||
| $ | in_kml_uri_string = null, |
||
| $ | in_worldid_mixed = null, |
||
| $ | in_sb_type = null, |
||
| $ | in_sb_owner = null |
||
| ) | [static] |
Creates a new Service Body in the Database.
| in_name_string | The Service Body's Name |
| in_lang_enum | The language for the Service Body |
| in_principal_user_bigint | The ID of the principal Service Body Administrator |
| in_description_string | The description of the Service Body (Optional) |
| in_editors_string | The IDs of the editors, as a CSV string (Optional) |
| in_uri_string | The Service Body Web Site URI (Optional) |
| in_kml_uri_string | The URI of a KML file that contains the Service Boundaries of the Service Body (Optional) |
| in_worldid_mixed | The World ID (if one is available) (Optional) |
| 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. |
| static c_comdef_server::AddNewUser | ( | $ | in_user_login, |
| $ | in_user_unencrypted_password, | ||
| $ | in_user_level, | ||
| $ | in_user_email, | ||
| $ | in_name_string = null, |
||
| $ | in_description_string = null, |
||
| $ | in_lang_enum = null |
||
| ) | [static] |
Creates a new user in the Database.
| in_user_login | The login for this user |
| in_user_unencrypted_password | The unencrypted password for this user |
| in_user_level | The level of this user |
| in_user_email | The email address for this user |
| in_name_string | The user's Name (Optional) |
| in_description_string | The description of the user (Optional) |
| in_lang_enum | The language for the user (Optional -If not supplied, the server default will be used) |
| static c_comdef_server::DoesMeetingExist | ( | $ | in_id_bigint | ) | [static] |
Given an ID for a meeting, it returns true if the meeting currently exists.
| an | exception if the SQL query fails. |
| in_id_bigint | The ID of the meeting (An integer) |
Referenced by DisplayChangedMeetingReports(), DisplayDeletedMeetingReports(), and GetChangedMeetings().
| static c_comdef_server::DuplicateMeetingID | ( | $ | in_meeting_id | ) | [static] |
This creates a new meeting that is an exact duplicate of the object for the meeting whose ID is passed in. The new meeting has a new ID, and is unpublished.
| in_meeting_id | The ID of the meeting to be copied. |
| static c_comdef_server::DuplicateMeetingObj | ( | $ | in_meeting_obj | ) | [static] |
This creates a new meeting that is an exact duplicate of the object passed in. The new meeting has a new ID, and is unpublished.
| in_meeting_obj | A reference to the meeting object to be copied. |
| & c_comdef_server::GetAllServiceIDs | ( | ) |
Simply returns the stored service IDs for ALL Service Bodies.
| static c_comdef_server::GetChangesFromIDAndType | ( | $ | in_type, |
| $ | in_id = null, |
||
| $ | in_start_date = null, |
||
| $ | in_end_date = null |
||
| ) | [static] |
Gets a list of all change objects of a certain type, or only one, if the change affects a certain class, and an ID is given for that class (not the change ID -the ID of the changed object).
| an | exception if the SQL query fails. |
| in_type | The class type for the changes One of these values: |
| in_id | The ID for the object. If not specified, all changes for the given type will be returned (WARNING: Could be a great many). |
| in_start_date | If you specify a start date (In PHP time() format), then only changes on, or after this date will be returned. |
| in_end_date | If you specify an end date (In PHP time() format), then only changes that occurred on, or before this date will be returned. |
Referenced by GetChanges().
| static c_comdef_server::GetChangesFromOTypeAndCType | ( | $ | in_o_type, |
| $ | in_change_type | ||
| ) | [static] |
This function allows you to get a list of changes by object type, and change type (such as all deleted meetings, or all rolled-back formats).
| an | exception if the SQL query fails. |
| in_o_type | The class type for the changes One of these values: |
| in_change_type | The change type. Can be:
|
Referenced by GetDeletedMeetings().
| c_comdef_server::GetChangesFromSQL | ( | $ | in_sql, |
| $ | in_value_array = null |
||
| ) |
Given an SQL statement and a value array (for DBO prepared statements), return a new c_comdef_changes object, loaded with the instances of the changes that were returned from the query.
| an | exception if the SQL query fails. |
| in_sql | The prepared statement SQL query |
| in_value_array | An array of values for the prepared statement. |
| static c_comdef_server::GetChangesTableName_obj | ( | ) | [static] |
Simply returns the name of the changes table.
| static& c_comdef_server::GetCurrentUserObj | ( | $ | in_is_ajax = false | ) | [static] |
Get the current logged-in user, as a c_comdef_user instance.
| in_is_ajax | If it's an AJAX handler, this is true. |
Referenced by c_comdef_user::DeleteFromDB(), c_comdef_service_body::DeleteFromDB(), c_comdef_meeting::DeleteFromDB(), c_comdef_format::DeleteFromDB(), c_comdef_meeting::DeleteFromDB_NoRecord(), DisplayAdvancedSearchDiv(), DisplayChangedMeetingReports(), DisplayDeletedMeetingReports(), DisplayFormatsForEdit(), DisplayMeeting(), DisplayMeetingForEdit(), DisplayMeetingForm(), DisplayMeetingReports(), DisplayOneMeeting(), DisplayOneServiceBodyEditor(), DisplayOneUserForEditing(), DisplayPageData(), DisplaySearchResultsList(), DisplaySearchResultsMap(), DisplayServiceBodyEditor(), DisplaySingleMeeting(), DisplayUserEditor(), GetControlPanelHTML(), GetMeetings(), c_comdef_service_body::IsUserInServiceBody(), c_comdef_service_body::IsUserInServiceBodyHierarchy(), c_comdef_meetings::RemoveInvalidMeetings(), c_comdef_user::UpdateToDB(), c_comdef_service_body::UpdateToDB(), c_comdef_meeting::UpdateToDB(), c_comdef_format::UpdateToDB(), c_comdef_user::UserCanEdit(), c_comdef_service_body::UserCanEdit(), c_comdef_meeting::UserCanEdit(), c_comdef_format::UserCanEdit(), and c_comdef_meeting::UserCanObserve().
| static c_comdef_server::GetEncryptedPW | ( | $ | in_login, |
| $ | in_password | ||
| ) | [static] |
Given a login and password, looks up the user, and returns an encrypted password for that user.
| in_login | A string. The login ID. |
| in_password | A string. the UNENCRYPTED password for the user. |
| c_comdef_server::GetFormatsObj | ( | ) |
Simply returns a reference to the formats container.
| static c_comdef_server::GetFormatTableName_obj | ( | ) | [static] |
Simply returns the name of the format table.
| static c_comdef_server::getKmPerLonAtLat | ( | $ | dLatitude | ) | [static] |
| c_comdef_server::GetLocalLang | ( | ) |
Returns the Server Local Language.
| static c_comdef_server::GetLocalStrings | ( | $ | in_lang_enum = null | ) | [static] |
This gets the appropriate language files, and puts all the the strings into an associative array. If a language enum is passed in, and the language directory exists, then the strings are loaded from that directory. If nothing is passed in, the first place we look is in the HTTP query, to see if a 'lang_enum' query is present. If it is there, we use that. If not, we use the base server language.
< This is a format string for the way the address line is displayed in the "more details" screen.
< The same, but for the list.
| in_lang_enum | An enumeration string, indicating the language desired. If provided, it overrides all else. |
Referenced by BuildTime(), c_comdef_admin_bar(), c_comdef_htmlspecialchars(), c_comdef_LoginForm(), c_comdef_change::DescribeChange(), c_comdef_change::DetailedChangeDescription(), DisplayAdvancedSearchDiv(), DisplayChangedMeetingReports(), DisplayDeletedMeetingReports(), DisplayFormatsForEdit(), DisplayMeeting(), DisplayMeetingForEdit(), DisplayMeetingForm(), DisplayMeetingReports(), DisplayMeetingSearchForm(), DisplayNewMeetingForm(), DisplayOneMeeting(), DisplayOneServiceBodyEditor(), DisplayOneUserForEditing(), DisplayPageData(), DisplayReportsDiv(), DisplayResultNav(), DisplaySearchResultsCSV(), DisplaySearchResultsList(), DisplaySearchResultsMap(), DisplayServiceBodyEditor(), DisplaySingleMeeting(), DisplayUserEditor(), c_comdef_meeting::GetAddressDataItemBuilder(), c_comdef_meeting::GetAddressDataItemKeys(), GetChanges(), GetControlPanelHTML(), GetGeocodeFromString(), GetHeaderXHTML(), ReturnAServiceBodyDL(), and SetUpSearch().
| static c_comdef_server::GetMeetings | ( | $ | in_service_body_id_bigint_array = null, |
| $ | in_lang_filter_array = null, |
||
| $ | in_weekday_tinyint_array = null, |
||
| $ | in_formats = null, |
||
| $ | in_start_after = null, |
||
| $ | in_start_before = null, |
||
| $ | in_min_duration = null, |
||
| $ | in_max_duration = null, |
||
| $ | in_search_rect_array = null, |
||
| $ | in_first = null, |
||
| &$ | in_num = null, |
||
| $ | in_published = 0 |
||
| ) | [static] |
Given a set of one or more main criteria, returns a new c_comdef_meetings object with instances of those meetings, loaded from the database.
This is the big kahuna. Meeting searches will all use this function as a fulcrum for their searches.
NOTE TO UPTIGHT PROGRAMMERS: Yeah, it's a big, massive function with a gazillion multi-purpose parameters.
Learn to live with it. It works fine, and makes sense for the context. I could break it into a bunch of smaller functions, but that would increase the complexity and reduce performance.
| an | exception if the SQL query fails. |
| in_service_body_id_bigint_array | An array of integers. Unlike the formats criteria, these do an OR function, as each record only has one Service Body ID field, so each selection broadens the search. If there are no IDs selected, or only NOT IDs have been selected, then all the Service bodies will be searched, with the exception of any that are selected as NOT (Negative value). |
| in_lang_filter_array | If an element of this array is set to a language enum ("en", "es", etc.), it will only return meetings whose 'lang_enum' field is of that value. If the array is null, all languages are searched. If the enum is preceded by a minus sign (-), then the language is filtered against in the search. |
| in_weekday_tinyint_array | The weekday (An array of integer 1-Sunday, 7-Saturday). Optional. If null, all days will be returned. Each day chosen widens the search. If the weekday is negative, then that is specifically filtered against in the search. |
| in_formats | An array of integers. These are formats. The filtering will be an "AND" filtering, so qualified meetings must have all of the given formats. If a format is given as a negative number, it is a NOT. Make sure that you don't have two versions of the same format code, as nothing will be returned. |
| in_start_after | An epoch time (seconds, as returned by time()), that denotes the earliest starting time allowed. |
| in_start_before | An epoch time (seconds, as returned by time()), that denotes the latest starting time allowed. |
| in_min_duration | The number of seconds a meeting should last as a minimum. |
| in_max_duration | The number of seconds a meeting can last, at most. |
| in_search_rect_array | An array of floating-point numbers, representing longitude and latitude for a rectangle. This is used to restrict the search to a certain geographic area. It is an associative array:
|
| in_first | A positive integer. This is for paged results. This is the index (0-based) of the first result to be returned. If $in_num is specified, and this is null, then it is assumed to be 0. If $in_num is null, then this is ignored. |
| in_num | A reference to a positive integer. This is the maximum number of results to return. If null, then there will be limits placed on the query. If less than the maximum are returned, this is adjusted to reflect how many were returned. |
NOTE: For non-MySQL and non-Oracle DBs, this may not equal the number of meetings returned in the function result! This is because, for those databases, filtering by format code needs to be done after the actual database query.
This will have the actual value of the number of results in the database query, so you can use this to walk through the database. If you need the actual number of meetings returned, the best way to do this is to do a c_comdef_meetings::GetNumMeetings() function on the returned object.
| in_published | Indicates whether or not to search for published meetings. This only counts if the user is logged in.
|
Referenced by c_comdef_meeting_search_manager::GetSearchResults_Obj().
| static c_comdef_server::GetMeetingsByID | ( | $ | in_id_bigint_array | ) | [static] |
Get a series of meetings, each identified by an ID. This does not filter by any of the other major criteria. It is designed to facilitate direct access to meeting objects.
| in_id_bigint_array | The ID of the meetings (An array of integers) |
Referenced by c_comdef_meeting_search_manager::GetSearchResults_Obj().
| static c_comdef_server::GetMeetingsForAServiceBody | ( | $ | in_sb_id | ) | [static] |
Returns a c_comdef_meetings_object, containing all the meetings directly "owned" by the Service Body whose ID is submitted.
| an | exception if the SQL query fails. |
| in_sb_id | An integer. The ID of the Service Body. |
| static c_comdef_server::GetMeetingsFromSQL | ( | $ | in_sql, |
| $ | in_value_array = null |
||
| ) | [static, private] |
Given an SQL statement and a value array (for PDO prepared statements), return a new c_comdef_meetings object, loaded with the instances of the meetings that were returned from the query.
| an | exception if the SQL query fails. |
| in_sql | The prepared statement SQL query |
| in_value_array | An array of values for the prepared statement. |
| static c_comdef_server::GetMeetingTableName_obj | ( | ) | [static] |
Simply returns the name of the meetings table.
| static c_comdef_server::GetNamespace | ( | ) | [static] |
Simply returns the namespace of this server.
| c_comdef_server::GetNestedServiceBodyArray | ( | $ | in_id = 0 | ) |
This reads the Service bodies in hierarchical order, and returns them in a multi-dimensional array that reflects the hierarchy.
| in_id | The ID of the "top" Service body. If not supplied, we start at the top. |
| static c_comdef_server::GetNewMeetingID | ( | ) | [static] |
Gets an unused ID from the end of the table and returns it. It also sets that ID into the table AUTO_INCREMENT, so it can't get re-used.
Referenced by c_comdef_meeting::ReduceToArrays().
| static c_comdef_server::GetOneChange | ( | $ | in_id_bigint | ) | [static] |
Given an ID for a change, it returns one instance.
This will return one c_comdef_change object, with the parent this server (Not a c_comdef_changes object).
| an | exception if the SQL query fails. |
| in_id_bigint | The ID of the change (An integer) |
| static c_comdef_server::GetOneFormat | ( | $ | in_id_bigint, |
| $ | in_lang_enum | ||
| ) | [static] |
Given an ID and a language for a format, it returns one instance.
This will return one c_comdef_format object, with the parent this server (Not a c_comdef_formats object).
| an | exception if the SQL query fails. |
| in_id_bigint | The ID of the formatShared (An integer) |
| in_lang_enum | The language for the format. |
Referenced by c_comdef_format::DeleteFromDB(), and c_comdef_format::UpdateToDB().
| static c_comdef_server::GetOneMeeting | ( | $ | in_id_bigint, |
| $ | test_only = false |
||
| ) | [static] |
Given an ID for a meeting, it returns one instance.
This will return one c_comdef_meeting object, with the parent this server (Not a c_comdef_meetings object).
| an | exception if the SQL query fails. |
| in_id_bigint | The ID of the meeting (An integer) |
| test_only | If true, then this function will only return Boolean true or false (true if the meeting exists) |
Referenced by c_comdef_change::GetBeforeObject(), GetChanges(), GetDeletedMeetings(), c_comdef_meeting_search_manager::GetSingleMeetingByID(), and c_comdef_change::Rollback().
| static c_comdef_server::GetOneUser | ( | $ | in_id_bigint | ) | [static] |
Given an ID for a user, it returns one instance.
This will return one c_comdef_user object, with the parent this server (Not a c_comdef_users object).
| in_id_bigint | The ID of the user (An integer) |
Referenced by c_comdef_user::DeleteFromDB(), c_comdef_change::Rollback(), c_comdef_service_body::SetEditors(), and c_comdef_user::UpdateToDB().
| static c_comdef_server::GetRadiusSQL | ( | $ | in_search_rect_array | ) | [static] |
Return SQL for the given coordinates.
| an | exception if the SQL query fails. |
| in_search_rect_array | An array of floating-point values.
|
| static c_comdef_server::GetServer | ( | ) | [static] |
Referenced by c_comdef_change::__construct(), listprint_napdf::__construct(), booklet_napdf::__construct(), c_comdef_meeting::AddFormat(), c_comdef_change::DetailedChangeDescription(), DisplayFormatsForEdit(), DisplayMeetingForEdit(), DisplayNewMeetingForm(), DisplayOneServiceBodyEditor(), DisplayOneUserForEditing(), DisplaySearchResultsCSV(), DisplaySearchResultsList(), listprint_napdf::DrawFormatPage(), booklet_napdf::DrawFormatPage(), listprint_napdf::DrawListPage(), booklet_napdf::DrawListPage(), c_comdef_change::GetAfterObject(), GetAllIDs(), c_comdef_change::GetBeforeObject(), GetChangedMeetings(), GetChanges(), c_comdef_meeting::GetDataTableTemplate(), c_comdef_formats::GetFormatBySharedIDCodeAndLanguage(), c_comdef_meeting::GetLongDataTableTemplate(), c_comdef_meetings::GetMeetingsByKeyValue(), c_comdef_meetings::GetMeetingsByString(), GetUserServiceBodies(), c_comdef_service_body::IsOwnedBy(), IsSBRecursive(), c_comdef_service_body::IsUserInServiceBodyHierarchy(), c_comdef_meeting::process_meeting_row(), c_comdef_user::SetLogin(), c_comdef_meeting::UpdateToDB(), c_comdef_meeting::UserCanEdit(), and c_comdef_meeting::UserCanObserve().
| static& c_comdef_server::GetServerLangs | ( | ) | [static] |
Get the local readable string for the server languages.
Referenced by DisplayFormatsForEdit(), DisplayMeetingForEdit(), DisplayNewMeetingForm(), DisplayOneMeeting(), and DisplayOneServiceBodyEditor().
| static& c_comdef_server::GetServerUsersObj | ( | ) | [static] |
Get the object list for the server's registered users.
Referenced by DisplayUserEditor().
| static c_comdef_server::GetServiceBodiesTableName_obj | ( | ) | [static] |
Simply returns the name of the service bodies table.
| & c_comdef_server::GetServiceBodyArray | ( | ) |
Simply returns a reference to the contained Service Body array.
| c_comdef_server::GetServiceBodyArrayHierarchical | ( | ) |
Returns the Service Body objects in a nested, hierarchical array, with "parents" containing "children.".
| static& c_comdef_server::GetServiceBodyByIDObj | ( | $ | in_service_body_id_bigint | ) | [static] |
Get the object for a single service body, given an ID.
| in_service_body_id_bigint | An integer, containing the service body ID. |
Referenced by c_comdef_meetings::CreateMeetingObjects(), c_comdef_service_body::DeleteFromDB(), DisplayMeetingForEdit(), DisplayNewMeetingForm(), DisplayOneMeeting(), GetChanges(), c_comdef_service_body::GetOwner2IDObject(), c_comdef_service_body::GetOwnerIDObject(), c_comdef_meeting::GetServiceBodyObj(), c_comdef_service_body::UpdateToDB(), c_comdef_service_body::UserCanEdit(), c_comdef_meeting::UserCanEdit(), and c_comdef_meeting::UserCanObserve().
| & c_comdef_server::GetServiceIDs | ( | ) |
Simply returns the stored service IDs.
| static c_comdef_server::GetSquareForRadius | ( | $ | in_radius, |
| $ | in_long_in_degrees, | ||
| $ | in_lat_in_degrees | ||
| ) | [static] |
This is a static utility function that takes a specified radius and center point and calculates a square, in longitude and latitude points, that encompasses that radius. This greatly narrows the scope of the search, so the radius calculation will simply eliminate any meetings that are "in the corners.".
| in_radius | A positive floating-point number. The radius, in kilometers. |
| in_long_in_degrees | The longitude needs to be specified in degrees. |
| in_lat_in_degrees | The latitude needs to be specified in degrees. |
Referenced by c_comdef_meeting_search_manager::GetSquareForRadius().
| static& c_comdef_server::GetUserByIDObj | ( | $ | in_user_id_bigint | ) | [static] |
Get the object for a single user, given an ID.
| in_user_id_bigint | An integer, containing the user ID. |
Referenced by DisplayChangedMeetingReports(), DisplayDeletedMeetingReports(), DisplayMeetingForEdit(), GetChanges(), c_comdef_service_body::GetEditorsAsObjects(), and c_comdef_service_body::GetPrincipalUserObj().
| static& c_comdef_server::GetUserByLoginCredentials | ( | $ | in_login, |
| $ | in_password | ||
| ) | [static] |
Given a login and password, looks up the user, and returns a reference to that user object.
| in_login | A string. The login ID. |
| in_password | A string. the ENCRYPTED password for the user. |
| static& c_comdef_server::GetUsersByLevelObj | ( | $ | in_user_level_bigint, |
| $ | in_or_higher = false, |
||
| $ | in_include_disabled = false |
||
| ) | [static] |
Get the objects for all users of a certain user level.
| in_user_level_bigint | An integer, containing the user level. |
| in_or_higher | A Boolean. Set this to true to get all users of the given level or higher (numerically lower). Default is false, so only users of the exact level are given. |
| in_include_disabled | A Boolean. Set this to true to allow disabled users to be included. |
Referenced by DisplayOneServiceBodyEditor().
| static c_comdef_server::GetUserServiceBodies | ( | $ | in_user_id = null | ) | [static] |
Return all the Service Bodies this user is authorized with.
| in_user_id | The ID of the user. If not provided, the current user is checked. |
Referenced by DisplayMeetingForm().
| static c_comdef_server::GetUserTableName_obj | ( | ) | [static] |
Simply returns the name of the user table.
| static c_comdef_server::HuntForRadius | ( | $ | in_search_result_count, |
| $ | in_long_in_degrees, | ||
| $ | in_lat_in_degrees, | ||
| $ | in_weekday_tinyint_array | ||
| ) | [static] |
Find the smallest radius that contains at least the given number of meetings. The way this works is that the center is set, and the optimal radius is selected in kilometers to deliver that many meetings. The radius starts at 25 Km (about 10 miles), and goes up or down in 5Km "clicks." Under 5Km, it reduces to 0.5Km "clicks." It will not go out more than 100Km.
When it passes the threshold for the number of meetings in the square, the radius is selected, and the _search_radius is set to the number of Kilometers.
We are not looking for an exact meeting count. It should select the first radius that contains AT LEAST the number of meetings requested.
If not enough meetings are found, the radius ends up at 0.
| an | exception if the SQL query fails. |
| in_search_result_count | A positive integer. It specifies the number of meetings to find. |
| in_long_in_degrees | The longitude needs to be specified in degrees. |
| in_lat_in_degrees | The latitude needs to be specified in degrees. |
| in_weekday_tinyint_array | An array of weekdays in which to filter for. |
Referenced by GetGeocodeFromString(), and c_comdef_meeting_search_manager::GetSquareForRadius().
| c_comdef_server::Initialize | ( | ) |
This reads the Formats, Meeting and Service Entity IDs.
| static c_comdef_server::IsFormatKeyUnique | ( | $ | in_key_string, |
| $ | in_lang_enum | ||
| ) | [static] |
Given an ID and a language for a format, as well as a code, returns true if the code does NOT appear in the DB.
| an | exception if the SQL query fails. |
| in_key_string | A string. The key for which to search. |
| in_lang_enum | The language for the format. |
| static c_comdef_server::IsUserServerAdmin | ( | $ | in_user_obj = null, |
| $ | in_is_ajax = false |
||
| ) | [static] |
Find out if the user is a server admin.
| in_user_obj | A reference to a c_comdef_user object instance. If null, the current user will be checked. |
| in_is_ajax | If it's an AJAX handler, we don't regenerate the session. Some browsers seem antsy about that. |
Referenced by DeleteMeetings(), DisplayDeletedMeetingReports(), DisplayFormatsForEdit(), DisplayMeeting(), DisplayMeetingForEdit(), DisplayMeetingForm(), DisplayNewMeetingForm(), DisplayOneServiceBodyEditor(), DisplayOneUserForEditing(), DisplayPageData(), DisplayServiceBodyEditor(), DisplayUserEditor(), c_comdef_user::UserCanEdit(), c_comdef_service_body::UserCanEdit(), c_comdef_meeting::UserCanEdit(), and c_comdef_format::UserCanEdit().
| static c_comdef_server::MakeServer | ( | ) | [static] |
This is the factory for the server instantiation. It makes sure that only one instance exists.
Referenced by listprint_napdf::__construct(), booklet_napdf::__construct(), c_comdef_meeting_search_manager::__construct(), c_comdef_admin_bar(), DisplayAdvancedSearchDiv(), DisplayFormatsForEdit(), DisplayMeetingForm(), DisplayServiceBodyEditor(), DisplaySingleMeeting(), DisplayUserEditor(), and GetControlPanelHTML().
| static c_comdef_server::ParseMeetingsByFormats | ( | $ | in_meetings, |
| $ | in_formats | ||
| ) | [static, private] |
This is an alternative to the MySQL REGEXP test. It will go through all the meetings returned by a broad query, and remove any that do not contain all of the given formats.
| in_meetings | The result of c_comdef_server::GetMeetingsFromSQL() |
| in_formats | An array of integers. These are formats. The filtering will be an "AND" filtering, so qualified meetings must have all of the given formats. |
| c_comdef_server::ReadFormats | ( | ) |
This is an internal function that reads in all of the stored formats, in all provided languages, and instantiates local objects for them. Access them with the GetFormatsObj() member function afterwards.
Read in all the formats, and instantiate an array of objects.
We aren't allowed to have two formats for the same language, and the same shared ID.
We use a combination of the language and the shared ID as the keys, which allows us to sort better.
Create our internal container, and give it the array.
| c_comdef_server::ReadServiceBodies | ( | ) |
This is an internal function that reads in all of the stored service bodies and instantiates local objects for them. Access them with the GetServiceObj() member function afterwards.
Read in all the service bodies, and instantiate an array of objects.
| c_comdef_server::ReadServiceIDs | ( | ) |
This gathers the IDs of all the Service bodies that appear in meeting records. It is NOT a dump of the Service Bodies table.
| c_comdef_server::ReadUsers | ( | ) |
This is an internal function that reads in all of the stored users and instantiates local objects for them. Access them with the GetUsersObj() member function afterwards.
Read in all the users, and instantiate an array of objects.
Create our internal container, and give it the array.
| static c_comdef_server::SetServer | ( | $ | in_server_instance | ) | [static] |
Sets the server instance.
| static c_comdef_server::TrimChanges | ( | $ | in_type, |
| $ | in_id | ||
| ) | [static] |
trims the changes for the given item.
| in_type | This is a string that contains the class of the change record. |
c_comdef_server::$_changes_table_name = null [private] |
This is the name of the Changes table in the database.
c_comdef_server::$_format_table_name = null [private] |
This is the name of the Formats table in the database.
c_comdef_server::$_formats_obj = null [private] |
This is the container for the loaded formats.
c_comdef_server::$_meeting_table_name = null [private] |
This is the name of the Meetings table in the database.
c_comdef_server::$_server_lang_names = null [private] |
This contains the names of the server languages, in their languages. It is an associative array, based on the language enums.
c_comdef_server::$_server_namespace = null [private] |
This contains the server namespace, which is used to uniquely identify data from this server. The default is the server URI, with "/CoMDEF" appended.
c_comdef_server::$_service_bodies_table_name = null [private] |
This is the name of the Service Bodies table in the database.
c_comdef_server::$_service_ids = null [private] |
This has the IDs of all the Service entities that "own" meetings on the server.
c_comdef_server::$_service_obj_array = null [private] |
This contains the actual Service Body objects as a simple array.
c_comdef_server::$_user_table_name = null [private] |
This is the name of the user table in the database.
c_comdef_server::$_users_obj = null [private] |
This is the container for the loaded users.
c_comdef_server::$server_instance = null [static] |
This is the SINGLETON server instance. There can only be one...
c_comdef_server::$server_local_strings = null [static] |
This contains a cache of the local strings.
Referenced by GetLocalStrings().
1.7.4