BMLT Root Server
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
c_comdef_meeting_search_manager Class Reference

A class to control the basic common functionality of all meeting searches. More...

Public Member Functions

 __construct ($in_results_per_page=0, c_comdef_meeting_search_manager &$in_parent=null, c_comdef_meetings &$in_search_results=null, $in_pageno=0)
 Constructor. More...
 
 SetUpFormats ()
 Sets an internal array of integers, containing the Shared IDs for all available formats on the server. They are initialized to 0 (neutral). More...
 
GetFormats ()
 Accessor -Get a reference to the $_formats field. More...
 
 SetKeyValueSearch ($in_meeting_key, $in_meeting_key_value, $in_meeting_key_match_case=false, $in_meeting_key_contains=true)
 Sets a key/value search. More...
 
 SetSortByDistance ($in_sort_search_by_distance=false)
 Sets the sort by distance flag. More...
 
 SetUpServiceBodies ()
 Sets an internal array of integers, containing the IDs for all available service bodies on the server. They are initialized to 0 (neutral). More...
 
 GetResultsPerPage ()
 Accessor -Get the number of results per page. More...
 
 SetResultsPerPage ($in_results_per_page)
 Accessor -Set the number of results per page. This will only work on the root object. More...
 
 GetPageNo ()
 Accessor -Get the page number of this set. More...
 
 GetFirstIndexInPage ()
 Accessor -Get the index (1 - based) of the first meeting in this page. More...
 
 GetLastIndexInPage ()
 Accessor -Get the index (1 - based) of the last meeting in this page. More...
 
 GetNumberOfPages ()
 Accessor -Get the page number of this set. More...
 
 GetNumberOfResults ()
 Accessor -Get the total number of meetings found. This gives the TOTAL number found, not just the subset in this page. More...
 
 GetNumberOfResultsInThisPage ()
 Accessor -Get the number of meetings in this page. More...
 
 GetPageOfResults ($in_page_no=1)
 Accessor -Get the number of meetings in this page. More...
 
GetServiceBodies ()
 Accessor -Get a reference to the $_service_bodies field. More...
 
 SetUpLanguages ()
 Sets up an internal array of languages. The array uses the language enum as the key, and the -1->0->1 form as the selector. More...
 
GetLanguages ()
 Accessor -Get a reference to the $_languages field. More...
 
GetWeekdays ()
 Accessor -Get a reference to the $_weekdays field. More...
 
 GetServer ()
 Accessor -Get a reference to the c_comdef_server object. More...
 
 GetRootObject ()
 Accessor -Get a reference to the root object. More...
 
 SetSearchRadiusAndCenterInMiles ($in_search_radius_in_miles, $in_long_in_degrees, $in_lat_in_degrees)
 Set a search radius and center, with the Radius in miles. More...
 
 SetSearchRadiusAndCenterInKm ($in_search_radius_in_km, $in_long_in_degrees, $in_lat_in_degrees)
 Set a search radius and center, with the radius in Km. More...
 
 SetSearchRadiusAndCenterAuto ($in_search_result_count, $in_long_in_degrees, $in_lat_in_degrees)
 Set a search center, and a count for an auto radius hunt. 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. More...
 
 GetRadius ($in_miles=false)
 Get the search radius. More...
 
 GetLongitude ()
 Get the longitude. More...
 
 GetLatitude ()
 Get the latitude. More...
 
 GetPublished ()
 Get the search for published value. More...
 
 SetPublished ($in_published_search)
 Sets the search for published value. More...
 
 SetStartTime ($in_starts_after, $in_starts_before=null)
 Set a start time window. More...
 
 SetEndTime ($in_ends_before)
 Set a maximum end time. More...
 
 GetEndsBefore ()
 Get the "ends before" value. More...
 
 GetStartTime_Min ()
 Get the "starts after" value. More...
 
 GetStartTime_Max ()
 Get the "starts before" value. More...
 
 SetDuration ($in_max_duration, $in_min_duration=null)
 Set a duration time window. More...
 
 GetDuration_Max ()
 Get the Maximum Duration value. More...
 
 GetDuration_Min ()
 Get the Minimum Duration value. More...
 
 SetSearchString ($in_search_string, $in_all_words=false, $in_literal=false)
 Set a search string. More...
 
 GetSearchString ()
 Get the current search string. More...
 
 SetMeetingIDArray ($in_meeting_id_array)
 Set the current search string. More...
 
 GetMeetingIDArray ()
 Get the current search string. More...
 
 StringSearchForAllWords ()
 Get the current search string "all words" flag. More...
 
 StringSearchIsLiteral ()
 Get the current search string literal flag. More...
 
 GetAvailableLanguages ()
 These functions will help the caller to get information from the server. You can use them to build a search form. More...
 
 GetAvailableServiceBodies ()
 Returns an array of references to c_comdef_service_body objects. More...
 
 GetAvailableFormats ()
 Returns a multi-dimensional array of references to c_comdef_format objects. More...
 
 GetSpecificSortKeys ()
 These functions deal with the search itself. More...
 
 DoSearch ()
 Executes a new search. It will always force a new search. More...
 
 GetSearchResults_Obj ($in_new_search=false)
 Returns a reference to the c_comdef_meetings object that contains the results of the search. If this is null, or if the $in_new_search parameter is set to true, the search will be executed, otherwise, this just returns a reference to the existing search results. More...
 
 ClearSearch ()
 Clears the search results, so the next access will redo the search. More...
 
 GetSearchResultsAsArray ()
 This will return the search results as an array of c_comdef_meeting objects. More...
 
 ClearSort ()
 These are sorting functions. More...
 
 SetSortDepth ($in_new_depth=0)
 Accessor. Set the maximum number of sorts to maintain. If the current number is more than the new value, then we remove any beyond that. More...
 
 SetTopSortPriority ($in_new_top_sort_key, $in_desc=false)
 Set a new "top" sort priority. More...
 
 SetSort ($in_sort_fields_array=null, $in_desc=false, $in_max_sort_keys=0)
 Sets up the sort array and direction. This replaces the entire array and direction. If the array is longer than the maximum number of sort keys, only that number of keys are used. More...
 
 SortMeetingObjects ($in_sort_fields_array=null, $in_desc=null)
 Sorts the meetings. This will apply a sort, dependent upon the given fields. The given array contains the field names (SQL columns and keys) for the data to be sorted. More...
 
 GetSquareForRadius ($in_weekday_tinyint_array, $in_service_bodies_array=null)
 These are various utility functions. More...
 
 SetFormatsComparisonOperator ($operator)
 

Static Public Member Functions

static GetAllAvailableSortKeys ()
 Returns an array of all possible field keys to be used for sorting. More...
 
static GetSingleMeetingByID ($in_id)
 These are static functions for directly accessing meetings via ID. More...
 
static GetMultipleMeetingsByID ($in_id_array)
 This is a static utility function that will return multiple instances of c_comdef_meeting, based upon the IDs of the meetings. It will create an array to hold these instances. More...
 

Protected Attributes

 $_formats = null
 These fields are used to specify the search criteria. More...
 
 $_formats_comparison_operator = "AND"
 
 $_service_bodies = null
 
 $_languages = null
 
 $_weekdays = null
 
 $_start_after = null
 These specify the start time and duration of the meeting. The start time can be specified as a "window.". More...
 
 $_start_before = null
 An epoch time (seconds, as returned by time()), that denotes the latest starting time allowed. More...
 
 $_end_before = null
 An epoch time (seconds, as returned by time()), that denotes the latest ending time allowed. More...
 
 $_min_duration = null
 The number of seconds a meeting should last as a minimum. More...
 
 $_max_duration = null
 The number of seconds a meeting can last, at most. More...
 
 $_search_radius = null
 These specify the search radius (We store it in kilometers). More...
 
 $_search_radius_count = null
 If this is not null, it needs to be a positive integer, indicating the number of meetings to find automatically. More...
 
 $_search_center_long = null
 If $_search_radius is not null, this needs to be a floating-point number that indicates the longitude, in degrees, of the search center. More...
 
 $_search_center_lat = null
 If $_search_radius is not null, this needs to be a floating-point number that indicates the latitude, in degrees, of the search center. More...
 
 $_search_string = null
 We allow a broad string search that goes through all the text items. In English and Spanish, it uses metaphone, which is a "sounds like" phonetic search. More...
 
 $_search_string_all_words = false
 A Boolean. If this is true, then all of the words in a phrase must be present. More...
 
 $_search_string_literal = false
 A Boolean. If this is true, then the spelling must be literal. More...
 
 $_meeting_key = null
 This allows you to filter out a particular value for a key. More...
 
 $_meeting_key_value = null
 
 $_meeting_key_match_case = false
 
 $_meeting_key_contains = false
 If this is false, then the string must be complete. Default is false (literal). More...
 
 $_meeting_id_array = null
 This contains a list of IDs of individual meetings. If it is set, then all other search parameters are ignored. More...
 
 $_published_search = 0
 This indicates whether the search should include, exclude, or focus on "published" meetings. More...
 
 $_sort_search_by_distance = false
 If this is true, then the search results may be sorted by distance from the geo center. More...
 
 $_search_results = null
 This contains the search results. More...
 

Private Attributes

 $sort_array = null
 This contains an array of strings that represent the sort keys. More...
 
 $sort_desc = false
 This is set to true if the sort is a reverse sort. More...
 
 $sort_depth = 3
 An integer. This is how far back a staged sort goes. Default is 3. 0 is forever. More...
 
 $_results_per_page = 0
 This refers to portions of a larger search (pages). More...
 
 $_pageno = 0
 An integer. The page number represented by this object. If $_results_per_page is 0, this is ignored. More...
 
 $_my_root = null
 If this isn't the root, then this will be a reference to the root. More...
 
 $_my_server = null
 A reference to a c_comdef_server object. This is the server to be used for the search. More...
 

Detailed Description

A class to control the basic common functionality of all meeting searches.

Definition at line 58 of file c_comdef_meeting_search_manager.class.php.

Constructor & Destructor Documentation

__construct (   $in_results_per_page = 0,
c_comdef_meeting_search_manager $in_parent = null,
c_comdef_meetings $in_search_results = null,
  $in_pageno = 0 
)

Constructor.

Parameters
$in_results_per_pageAn integer that defines how many results per page you want to see. 0 (default) is all in one page.
$in_parentA reference to an existing c_comdef_meeting_search_manager object.
$in_search_resultsA reference to some pre-parsed search results.
$in_pagenoAn integer. The page of the main search this is from.

Definition at line 164 of file c_comdef_meeting_search_manager.class.php.

References c_comdef_server\MakeServer().

169  {
170  // If this is a page of results, we set up the object to reference the root.
171  if ($in_parent instanceof c_comdef_meeting_search_manager) {
172  $this->_my_root = $in_parent;
173  // These all reference the root object's values.
174  $this->_formats = $in_parent->_formats;
175  $this->_formats_comparison_operator = $in_parent->_formats_comparison_operator;
176  $this->_service_bodies = $in_parent->_service_bodies;
177  $this->_languages = $in_parent->_languages;
178  $this->_weekdays = $in_parent->_weekdays;
179  $this->_start_after = $in_parent->_start_after;
180  $this->_start_before = $in_parent->_start_before;
181  $this->_end_before = $in_parent->_end_before;
182  $this->_min_duration = $in_parent->_min_duration;
183  $this->_max_duration = $in_parent->_max_duration;
184  $this->_search_radius = $in_parent->_search_radius;
185  $this->_search_center_long = $in_parent->_search_center_long;
186  $this->_search_center_lat = $in_parent->_search_center_lat;
187  $this->_search_string = $in_parent->_search_string;
188  $this->_meeting_id_array = $in_parent->_meeting_id_array;
189  $this->_published_search = $in_parent->_published_search;
190 
191  $this->_my_server = $in_parent->_my_server;
192 
193  // These may get changed by this instance.
194  $this->sort_array = $in_parent->sort_array;
195  $this->sort_desc = $in_parent->sort_desc;
196 
197  // These are passed in and set at construction
198  $this->_pageno = $in_pageno;
199  $this->_search_results = $in_search_results;
200  } else // If we are the root object, we start clean.
201  {
202  // See if the caller has requested a number of results per page.
203  if ($in_results_per_page) {
204  $this->_results_per_page = $in_results_per_page;
205  }
206 
207  $this->_my_server = c_comdef_server::MakeServer(); // We initialize the server.
208 
209  $this->SetUpFormats(); // We set the formats array.
210  $this->SetUpServiceBodies(); // We set the Service Bodies array.
211  $this->SetUpLanguages(); // We set the Languages array.
212 
213  // Set up the weekday array (1 = Sunday, 7 = Saturday ).
214  $this->_weekdays = null;
215  for ($wd = 1; $wd < 8; $wd++) {
216  $this->_weekdays[$wd] = 0;
217  }
218 
219  // This is the default sort.
220  $this->sort_array = array ( "lang_enum", "weekday_tinyint", "start_time", "id_bigint" );
221 
222  // We have no search parameters or results at this point.
223  }
224  }
SetUpLanguages()
Sets up an internal array of languages. The array uses the language enum as the key, and the -1->0->1 form as the selector.
static MakeServer()
This is the factory for the server instantiation. It makes sure that only one instance exists...
SetUpServiceBodies()
Sets an internal array of integers, containing the IDs for all available service bodies on the server...
SetUpFormats()
Sets an internal array of integers, containing the Shared IDs for all available formats on the server...
A class to control the basic common functionality of all meeting searches.

Member Function Documentation

ClearSearch ( )

Clears the search results, so the next access will redo the search.

Definition at line 1237 of file c_comdef_meeting_search_manager.class.php.

1238  {
1239  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1240  // Only the root can clear its search results.
1241  if (null == $this->_my_root) {
1242  $this->_search_results = null;
1243  }
1244  }
ClearSort ( )

These are sorting functions.

Simply clears out the sort array, so the search is unsorted.

Definition at line 1275 of file c_comdef_meeting_search_manager.class.php.

1276  {
1277  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1278  // Only the root can do this.
1279  if (null == $this->_my_root) {
1280  $this->sort_array = null;
1281  }
1282  }
DoSearch ( )

Executes a new search. It will always force a new search.

Returns
an integer that indicates the number of meetings found.

Definition at line 1086 of file c_comdef_meeting_search_manager.class.php.

References $ret.

1087  {
1088  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1089  $this->GetSearchResults_Obj(true);
1090 
1091  $ret = $this->GetNumberOfResults();
1092 
1093  return $ret;
1094  }
$ret
Definition: contact.php:226
GetNumberOfResults()
Accessor -Get the total number of meetings found. This gives the TOTAL number found, not just the subset in this page.
GetSearchResults_Obj($in_new_search=false)
Returns a reference to the c_comdef_meetings object that contains the results of the search...
static GetAllAvailableSortKeys ( )
static

Returns an array of all possible field keys to be used for sorting.

Returns
an array of strings, with the key being the same as the value. NOTE: This contains ALL possible keys, including ones that may not be used in the found set.

Definition at line 1049 of file c_comdef_meeting_search_manager.class.php.

References c_comdef_meeting\GetAllMeetingKeys().

1050  {
1051  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1053  }
static GetAllMeetingKeys()
Returns an array of strings, containing the keys (table columns) used for all meetings (specified in ...
GetAvailableFormats ( )

Returns a multi-dimensional array of references to c_comdef_format objects.

This returns ALL formats; whether or not they are used in meetings.

Returns
a reference to a multi-dimensional array of c_comdef_format objects. The key will be the language enum, and the value will be another array, which will have its key as the Shared ID of the format, and the value will be a reference to the object. Null, if the function fails for any reason.

This will reference the actual objects controlled by the server.

Definition at line 1023 of file c_comdef_meeting_search_manager.class.php.

References $ret.

1024  {
1025  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1026  $ret = null;
1027 
1028  // Basic error checking.
1029  if ($this->_my_server instanceof c_comdef_server) {
1030  // Start by getting the format aggregator object.
1031  $formats_obj = $this->_my_server->GetFormatsObj();
1032 
1033  if ($formats_obj instanceof c_comdef_formats) {
1034  $ret = $formats_obj->GetFormatsArray();
1035  }
1036  }
1037 
1038  return $ret;
1039  }
$ret
Definition: contact.php:226
Include the format class.
This class is the main server class. It instantiates a PDO database object, and is the starting point...
GetAvailableLanguages ( )

These functions will help the caller to get information from the server. You can use them to build a search form.

Returns an array of language enums and names.

Returns
a reference to an array of strings, containing the server languages in human-readable, local form. The key will be the enum, and the value will be the name of the language.

Definition at line 972 of file c_comdef_meeting_search_manager.class.php.

References $ret.

973  {
974  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
975  $ret = null;
976 
977  // Basic error checking.
978  if ($this->_my_server instanceof c_comdef_server) {
979  $ret = $this->_my_server->GetServerLangs();
980  }
981 
982  return $ret;
983  }
$ret
Definition: contact.php:226
This class is the main server class. It instantiates a PDO database object, and is the starting point...
GetAvailableServiceBodies ( )

Returns an array of references to c_comdef_service_body objects.

This returns ALL Service bodies; whether or not they contain meetings.

Returns
a reference to an array of c_comdef_service_body objects. The key will be the ID of the Service body, and the value will be a reference to the object. Null, if the function fails for any reason.

This will reference the actual objects controlled by the server.

Definition at line 997 of file c_comdef_meeting_search_manager.class.php.

References $ret.

998  {
999  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1000  $ret = null;
1001 
1002  // Basic error checking.
1003  if ($this->_my_server instanceof c_comdef_server) {
1004  $ret = $this->_my_server->GetServiceBodyArray();
1005  }
1006 
1007  return $ret;
1008  }
$ret
Definition: contact.php:226
This class is the main server class. It instantiates a PDO database object, and is the starting point...
GetDuration_Max ( )

Get the Maximum Duration value.

Returns
an integer, containing the epoch time for the value.

Definition at line 874 of file c_comdef_meeting_search_manager.class.php.

875  {
876  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
877  return $this->_max_duration;
878  }
$_max_duration
The number of seconds a meeting can last, at most.
GetDuration_Min ( )

Get the Minimum Duration value.

Returns
an integer, containing the epoch time for the value.

Definition at line 886 of file c_comdef_meeting_search_manager.class.php.

887  {
888  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
889  return $this->_min_duration;
890  }
$_min_duration
The number of seconds a meeting should last as a minimum.
GetEndsBefore ( )

Get the "ends before" value.

Returns
an integer, containing the epoch time for the value.

Definition at line 819 of file c_comdef_meeting_search_manager.class.php.

820  {
821  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
822  return $this->_end_before;
823  }
$_end_before
An epoch time (seconds, as returned by time()), that denotes the latest ending time allowed...
GetFirstIndexInPage ( )

Accessor -Get the index (1 - based) of the first meeting in this page.

Returns
an integer.

Definition at line 385 of file c_comdef_meeting_search_manager.class.php.

386  {
387  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
388  return ($this->GetResultsPerPage() * ($this->GetPageNo() - 1)) + 1;
389  }
GetPageNo()
Accessor -Get the page number of this set.
GetResultsPerPage()
Accessor -Get the number of results per page.
& GetFormats ( )

Accessor -Get a reference to the $_formats field.

Returns
a reference to the $_formats field, which is an array of integers. The key is the format's shared ID, and the value will be one of these:
  • -1 NOT (exclude all meetings that contain this format from the search).
  • 0 No preference (This format will not be a consideration in the search).
  • 1 Return meetings that contain this format.

Default is 0 for all. If no formats are specified (either 1 or -1), then formats will not be a consideration in the meeting search. If any format is specified as 1, then ONLY meetings with the given format will be considered in the search, and you must explicitly set any other formats you wish found.

Definition at line 267 of file c_comdef_meeting_search_manager.class.php.

268  {
269  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
270  return $this->_formats;
271  }
$_formats
These fields are used to specify the search criteria.
& GetLanguages ( )

Accessor -Get a reference to the $_languages field.

Returns
a reference to the $_languages field. The key is the language enum, and the value is as follows:
  • -1 NOT (exclude all meetings that have this language from the search).
  • 0 No preference (This language will not be a consideration in the search).
  • 1 Return meetings that have this language.

Default is 0 for all. If no languages are specified (either 1 or -1), then language will not be a consideration in the meeting search. If any language is specified as 1, then ONLY meetings with the given language will be considered in the search, and you must explicitly set any other language you wish found.

Definition at line 589 of file c_comdef_meeting_search_manager.class.php.

590  {
591  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
592  return $this->_languages;
593  }
GetLastIndexInPage ( )

Accessor -Get the index (1 - based) of the last meeting in this page.

Returns
an integer.

Definition at line 397 of file c_comdef_meeting_search_manager.class.php.

398  {
399  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
400  return ($this->GetFirstIndexInPage() + $this->GetNumberOfResultsInThisPage()) - 1;
401  }
GetFirstIndexInPage()
Accessor -Get the index (1 - based) of the first meeting in this page.
GetNumberOfResultsInThisPage()
Accessor -Get the number of meetings in this page.
GetLatitude ( )

Get the latitude.

Returns
a floating-point number. The return is in degrees.

Definition at line 740 of file c_comdef_meeting_search_manager.class.php.

741  {
742  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
744  }
$_search_center_lat
If $_search_radius is not null, this needs to be a floating-point number that indicates the latitude...
GetLongitude ( )

Get the longitude.

Returns
a floating-point number. The return is in degrees.

Definition at line 728 of file c_comdef_meeting_search_manager.class.php.

729  {
730  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
732  }
$_search_center_long
If $_search_radius is not null, this needs to be a floating-point number that indicates the longitude...
GetMeetingIDArray ( )

Get the current search string.

Returns
a reference to the meeting ID array.

Definition at line 936 of file c_comdef_meeting_search_manager.class.php.

937  {
938  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
940  }
$_meeting_id_array
This contains a list of IDs of individual meetings. If it is set, then all other search parameters ar...
static GetMultipleMeetingsByID (   $in_id_array)
static

This is a static utility function that will return multiple instances of c_comdef_meeting, based upon the IDs of the meetings. It will create an array to hold these instances.

NOTE: This is NOT the same as the c_comdef_server::GetMeetingsByID() function, as that function returns an instance of c_comdef_meetings.

Returns
an array of new (not reference) c_comdef_meeting instances. Null if it fails.
Parameters
$in_id_arrayAn array of integers. The IDs of the meetings.

Definition at line 1524 of file c_comdef_meeting_search_manager.class.php.

References $ret.

1526  {
1527  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1528  $ret = null;
1529 
1530  if (is_array($in_id_array) && count($in_id_array)) {
1531  foreach ($in_id_array as $id) {
1532  $ret[$id] = c_comdef_search_manager::GetSingleMeetingByID($id);
1533  }
1534  }
1535 
1536  return $ret;
1537  }
$ret
Definition: contact.php:226
GetNumberOfPages ( )

Accessor -Get the page number of this set.

Returns
an integer.

Definition at line 409 of file c_comdef_meeting_search_manager.class.php.

References $ret.

410  {
411  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
412  $ret = 0;
413 
414  $respp = $this->GetResultsPerPage();
415  $resnum = $this->GetNumberOfResults();
416 
417  if ($respp > 0) {
418  $ret = intval(($resnum + ($respp - 1)) / $respp);
419  } elseif ($resnum > 0) {
420  $ret = 1;
421  }
422 
423  return $ret;
424  }
$ret
Definition: contact.php:226
GetNumberOfResults()
Accessor -Get the total number of meetings found. This gives the TOTAL number found, not just the subset in this page.
GetResultsPerPage()
Accessor -Get the number of results per page.
GetNumberOfResults ( )

Accessor -Get the total number of meetings found. This gives the TOTAL number found, not just the subset in this page.

Returns
an integer.

Definition at line 433 of file c_comdef_meeting_search_manager.class.php.

References $ret.

434  {
435  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
436  $ret = 0;
437 
438  if (!$this->_my_root && $this->_search_results instanceof c_comdef_meetings) {
439  $ret = $this->_search_results->GetNumMeetings();
440  } elseif ($this->_my_root instanceof c_comdef_meeting_search_manager) {
441  $ret = $this->_my_root->GetNumberOfResults();
442  }
443 
444  return $ret;
445  }
$ret
Definition: contact.php:226
A class to hold a collection of c_comdef_meeting objects.
A class to control the basic common functionality of all meeting searches.
GetNumberOfResultsInThisPage ( )

Accessor -Get the number of meetings in this page.

Returns
an integer.

Definition at line 453 of file c_comdef_meeting_search_manager.class.php.

References $ret.

454  {
455  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
456  $ret = 0;
457 
458  if ($this->_search_results instanceof c_comdef_meetings) {
459  $ret = $this->_search_results->GetNumMeetings();
460  }
461 
462  return $ret;
463  }
$ret
Definition: contact.php:226
A class to hold a collection of c_comdef_meeting objects.
GetPageNo ( )

Accessor -Get the page number of this set.

Returns
an integer.

Definition at line 373 of file c_comdef_meeting_search_manager.class.php.

374  {
375  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
376  return $this->_pageno;
377  }
$_pageno
An integer. The page number represented by this object. If $_results_per_page is 0, this is ignored.
GetPageOfResults (   $in_page_no = 1)

Accessor -Get the number of meetings in this page.

This system allows each page to be treated independently, like allowing different sorts without re-sorting the entire search.

This object needs to be the "root" object to return a page.

Returns
a new instance (not a reference) to a c_comdef_meeting_search_manager object, containing a subset of the meetings to fill this one page.
Parameters
$in_page_noA positive integer. This should be 1 to $this->GetNumberOfPages() (1-based)

Definition at line 477 of file c_comdef_meeting_search_manager.class.php.

References $ret.

479  {
480  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
481  if ($in_page_no < 1) { // Can't be less than 1.
482  $in_page_no = 1;
483  }
484 
485  if ($in_page_no > $this->GetNumberOfPages()) { // Can't be greater than the last page.
486  $in_page_no = $this->GetNumberOfPages();
487  }
488 
489  $ret = null;
490 
491  // We get pages from the root at all times.
492  if (!$this->_my_root && $this->_search_results instanceof c_comdef_meetings) {
493  // This is the starting index for our page of results.
494  $main_array_1 = $this->_search_results->GetMeetingObjects();
495  $main_array = array();
496  foreach ($main_array_1 as $meeting) {
497  array_push($main_array, $meeting);
498  }
499 
500  $ret_array = array();
501  $min = $this->GetResultsPerPage() * ($in_page_no - 1);
502  $actual = intval($this->GetResultsPerPage());
503  if ($actual > 0) {
504  $max = min(count($main_array), $min + $this->GetResultsPerPage());
505  } else {
506  $max = $this->GetNumberOfResults();
507  }
508 
509  for ($index = intval($min); $index < intval($max); $index++) {
510  if ($main_array[$index] instanceof c_comdef_meeting) {
511  $data = $main_array[$index]->GetMeetingData();
512  if (is_array($data) && count($data)) {
513  $ret_array[$data['id_bigint']] = $main_array[$index];
514  }
515  }
516  }
517 
518  if (count($ret_array)) {
519  $resultsObj = new c_comdef_meetings($this->_search_results->GetParentObj(), $ret_array);
520 
521  if ($resultsObj instanceof c_comdef_meetings) {
522  $ret = new c_comdef_meeting_search_manager(0, $this, $resultsObj, $in_page_no);
523  }
524  }
525  } elseif ($this->_my_root instanceof c_comdef_meeting_search_manager) {
526  $ret = $this->_my_root->GetPageOfResults($in_page_no);
527  }
528 
529  return $ret;
530  }
A class to hold a single meeting object.
GetNumberOfPages()
Accessor -Get the page number of this set.
$ret
Definition: contact.php:226
GetNumberOfResults()
Accessor -Get the total number of meetings found. This gives the TOTAL number found, not just the subset in this page.
GetResultsPerPage()
Accessor -Get the number of results per page.
A class to hold a collection of c_comdef_meeting objects.
A class to control the basic common functionality of all meeting searches.
GetPublished ( )

Get the search for published value.

Returns
an integer.
  • -1 Search for ONLY unpublished meetings
  • 0 Search for published and unpublished meetings.
  • 1 Search for ONLY published meetings.

Definition at line 755 of file c_comdef_meeting_search_manager.class.php.

756  {
757  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
759  }
$_published_search
This indicates whether the search should include, exclude, or focus on "published" meetings...
GetRadius (   $in_miles = false)

Get the search radius.

Returns
a floating-point number. If the $in_miles parameter is false, the returned value is kilometers. If it is true, the returned value is in miles.
Parameters
$in_milesA boolean. If true, the returned value will be in miles. Otherwise, it is returned in kilometers.

Definition at line 715 of file c_comdef_meeting_search_manager.class.php.

717  {
718  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
719  return $in_miles ? ($this->_search_radius / 1.609344) : $this->_search_radius;
720  }
GetResultsPerPage ( )

Accessor -Get the number of results per page.

Returns
an integer.

Definition at line 331 of file c_comdef_meeting_search_manager.class.php.

References $ret.

332  {
333  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
334  $ret = 0;
335 
336  // This is kept in the root object.
337  if (!$this->_my_root) {
339  } elseif ($this->GetRootObject() instanceof c_comdef_meeting_search_manager) {
340  $ret = $this->GetRootObject()->GetResultsPerPage();
341  }
342 
343  return $ret;
344  }
$_results_per_page
This refers to portions of a larger search (pages).
$ret
Definition: contact.php:226
GetRootObject()
Accessor -Get a reference to the root object.
A class to control the basic common functionality of all meeting searches.
GetRootObject ( )

Accessor -Get a reference to the root object.

Returns
a reference to the c_comdef_meeting_search_manager object. If this is the root object, it will return a reference to itself.

Definition at line 635 of file c_comdef_meeting_search_manager.class.php.

References $ret.

636  {
637  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
638  $ret = null;
639 
640  if ($this->_my_root instanceof c_comdef_meeting_search_manager) {
642  } else {
643  $ret = $this;
644  }
645 
646  return $ret;
647  }
$ret
Definition: contact.php:226
$_my_root
If this isn&#39;t the root, then this will be a reference to the root.
A class to control the basic common functionality of all meeting searches.
GetSearchResults_Obj (   $in_new_search = false)

Returns a reference to the c_comdef_meetings object that contains the results of the search. If this is null, or if the $in_new_search parameter is set to true, the search will be executed, otherwise, this just returns a reference to the existing search results.

Returns
a reference to the internal $_search_results field (an instance of c_comdef_search_results).
Parameters
$in_new_searchIf this is set to true, the search is done anew.

Definition at line 1107 of file c_comdef_meeting_search_manager.class.php.

References c_comdef_server\GetMeetings(), and c_comdef_server\GetMeetingsByID().

1109  {
1110  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1111  // See if we need to make a new search. Only the root can do a new search.
1112  if ((null == $this->_my_root) && (true == $in_new_search) || (null == $this->_search_results)) {
1113  $this->_search_results = null;
1114 
1115  // Basic error checking.
1116  if ($this->_my_server instanceof c_comdef_server) {
1117  // If we have an ID array, then we skip everything else, and just search for those IDs.
1118  if (is_array($this->_meeting_id_array) && count($this->_meeting_id_array)) {
1119  $this->_search_results = c_comdef_server::GetMeetingsByID($this->_meeting_id_array);
1120 
1121  if ($this->_search_results instanceof c_comdef_meetings) {
1122  $this->_search_results->RemoveInvalidMeetings();
1123 
1124  // Force a new sort.
1125  $this->SortMeetingObjects();
1126  }
1127  } else {
1128  // We start by specifying a search using the main criteria. We need to interpret the current state into search criteria.
1129 
1130  // Set up our Service Bodies Array.
1131  $service_bodies = null;
1132 
1133  if (is_array($this->_service_bodies) && count($this->_service_bodies)) {
1134  $service_bodies = array();
1135  foreach ($this->_service_bodies as $key => $value) {
1136  // If the value of the Service Body is 1 or -1, we add it to the list.
1137  if (abs($value) == 1) {
1138  array_push($service_bodies, intval($key) * $value);
1139  }
1140  }
1141  }
1142 
1143  // Set up our weekday array.
1144  $weekdays = null;
1145 
1146  if (is_array($this->_weekdays) && count($this->_weekdays)) {
1147  $weekdays = array();
1148  foreach ($this->_weekdays as $key => $value) {
1149  // If the value of the Weekday is 1 or -1, we add it to the list.
1150  if (abs($value) != 0) {
1151  array_push($weekdays, intval($key) * $value);
1152  }
1153  }
1154  }
1155 
1156  // Set up our formats array.
1157  $formats = null;
1158 
1159  if (is_array($this->_formats) && count($this->_formats)) {
1160  $formats = array();
1161  foreach ($this->_formats as $key => $value) {
1162  // If the value of the format is 1 or -1, we add it to the list.
1163  if (abs($value) == 1) {
1164  array_push($formats, intval($key) * $value);
1165  }
1166  }
1167  }
1168 
1169  $languages = null;
1170 
1171  if (is_array($this->_languages) && count($this->_languages)) {
1172  $languages = array();
1173  foreach ($this->_languages as $key => $value) {
1174  // If the value of the format is 1 or -1, we add it to the list.
1175  if (abs($value) == 1) {
1176  array_push($languages, ($value == -1) ? "-$key" : $key);
1177  }
1178  }
1179  }
1180 
1181  // If we will specify a search radius, we specify a restricted area for the search.
1182  $search_rect = $this->GetSquareForRadius($weekdays, $service_bodies);
1183 
1184  // Do the main database search first.
1185  $null_me = null;
1186  $this->_search_results = c_comdef_server::GetMeetings(
1187  $service_bodies,
1188  $languages,
1189  $weekdays,
1190  $formats,
1191  $this->_start_after,
1192  $this->_start_before,
1193  $this->_end_before,
1194  $this->_min_duration,
1195  $this->_max_duration,
1196  $search_rect,
1197  null,
1198  $null_me,
1199  $this->_published_search,
1200  $this->_formats_comparison_operator
1201  );
1202  if (isset($this->_search_results) && $this->_search_results && ($this->_search_results instanceof c_comdef_meetings)) {
1203  $this->_search_results->RemoveInvalidMeetings();
1204 
1205  // Force a new sort.
1206  $this->SortMeetingObjects();
1207 
1208  // These are two "post-database" searches that we do.
1209  if (null != $this->_search_radius) {
1210  $this->_search_results = $this->_search_results->GetMeetingsByDistance($this->_search_center_long, $this->_search_center_lat, $this->_search_radius, true, $this->_sort_search_by_distance);
1211  }
1212 
1213  if (null != $this->_search_string) {
1214  $_search_results = $this->_search_results->GetMeetingsByString($this->_search_string, null, $this->_search_string_all_words, $this->_search_string_literal);
1215  $this->_search_results = null;
1216  $this->_search_results = $_search_results;
1217  }
1218 
1219  if ($this->_meeting_key) {
1220  $key_array = (is_array($this->_meeting_key) && count($this->_meeting_key)) ? $this->_meeting_key : array ( $this->_meeting_key );
1221  $_search_results = $this->_search_results->GetMeetingsByKeyValue($key_array, $this->_meeting_key_value, $this->_meeting_key_contains, $this->_meeting_key_match_case);
1222  $this->_search_results = null;
1223  $this->_search_results = $_search_results;
1224  }
1225  }
1226  }
1227  }
1228  }
1229 
1230  return $this->_search_results;
1231  }
GetSquareForRadius($in_weekday_tinyint_array, $in_service_bodies_array=null)
These are various utility functions.
SortMeetingObjects($in_sort_fields_array=null, $in_desc=null)
Sorts the meetings. This will apply a sort, dependent upon the given fields. The given array contains...
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 cr...
This class is the main server class. It instantiates a PDO database object, and is the starting point...
A class to hold a collection of c_comdef_meeting objects.
$_search_results
This contains the search results.
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_end_before=null, $in_min_duration=null, $in_max_duration=null, $in_search_rect_array=null, $in_first=null, &$in_num=null, $in_published=0, $formats_comparison_operator="AND")
Given a set of one or more main criteria, returns a new c_comdef_meetings object with instances of th...
GetSearchResultsAsArray ( )

This will return the search results as an array of c_comdef_meeting objects.

Returns
a reference to an array of references to c_comdef_meeting objects.

Definition at line 1253 of file c_comdef_meeting_search_manager.class.php.

References $ret.

1254  {
1255  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1256  $ret = null;
1257 
1258  if ($this->GetSearchResults_Obj() instanceof c_comdef_meetings) {
1259  $s_array = $this->GetSearchResults_Obj()->GetMeetingObjects();
1260 
1261  if (is_array($s_array) && count($s_array)) {
1262  $ret = $s_array;
1263  }
1264  }
1265 
1266  return $ret;
1267  }
$ret
Definition: contact.php:226
GetSearchResults_Obj($in_new_search=false)
Returns a reference to the c_comdef_meetings object that contains the results of the search...
A class to hold a collection of c_comdef_meeting objects.
GetSearchString ( )

Get the current search string.

Returns
a reference to the search string.

Definition at line 913 of file c_comdef_meeting_search_manager.class.php.

914  {
915  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
916  return $this->_search_string;
917  }
$_search_string
We allow a broad string search that goes through all the text items. In English and Spanish...
GetServer ( )

Accessor -Get a reference to the c_comdef_server object.

Returns
a reference to the c_comdef_server object instantiated by this object.

Definition at line 622 of file c_comdef_meeting_search_manager.class.php.

623  {
624  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
625  return $this->_my_server;
626  }
$_my_server
A reference to a c_comdef_server object. This is the server to be used for the search.
& GetServiceBodies ( )

Accessor -Get a reference to the $_service_bodies field.

Returns
a reference to the $_service_bodies field. The key is the Service Body ID. The value is as follows:
  • -1 NOT (exclude all meetings that contain this Service Body from the search).
  • 0 No preference (This Service Body will not be a consideration in the search).
  • 1 Return meetings that contain this Service Body.

Default is 0 for all. If no Service Bodies are specified (either 1 or -1), then Service Bodies will not be a consideration in the meeting search. If any Service Body is specified as 1, then ONLY meetings with the given Service Body will be considered in the search, and you must explicitly set any other Service Bodies you wish found.

Definition at line 546 of file c_comdef_meeting_search_manager.class.php.

547  {
548  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
549  return $this->_service_bodies;
550  }
static GetSingleMeetingByID (   $in_id)
static

These are static functions for directly accessing meetings via ID.

This is a static utility function that will return one single instance of c_comdef_meeting, based upon the ID of that meeting.

Returns
a new (not reference) c_comdef_meeting instance. Null if it fails.
Parameters
$in_idAn integer. The ID of the meeting.

Definition at line 1505 of file c_comdef_meeting_search_manager.class.php.

References c_comdef_server\GetOneMeeting().

1507  {
1508  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1509  return c_comdef_server::GetOneMeeting($in_id);
1510  }
static GetOneMeeting($in_id_bigint, $test_only=false)
Given an ID for a meeting, it returns one instance.
GetSpecificSortKeys ( )

These functions deal with the search itself.

Returns an array of field keys to be used for sorting. This function is not static, and searches the found set for keys. As a result, it takes longer.

Returns
an array of strings, with the key being the same as the value. NOTE: This contains only the keys used in this found set.

As a result, this will return null until after a search has been performed.

Definition at line 1068 of file c_comdef_meeting_search_manager.class.php.

References $ret.

1069  {
1070  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1071  $ret = null;
1072 
1073  if ($this->_search_results instanceof c_comdef_meetings) {
1074  $ret = $this->_search_results->GetMeetingKeys();
1075  }
1076 
1077  return $ret;
1078  }
$ret
Definition: contact.php:226
A class to hold a collection of c_comdef_meeting objects.
GetSquareForRadius (   $in_weekday_tinyint_array,
  $in_service_bodies_array = null 
)

These are various utility functions.

This is an internal 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."

If the setting is for auto-radius, the auto-radius is first resolved, then the main radius value is set. Remember that auto-radius is for all meetings, all days of the week. It is really a "density test," as opposed to an accurate selector.

Returns
an array of floating-point values, in the following form:
  • ['east'] = longitude of the Eastern side of the rectangle
  • ['west'] = longitude of the Western side of the rectangle
  • ['north'] = latitude of the Northern side of the rectangle
  • ['south'] = latitude of the Southern side of the rectangle
Parameters
$in_weekday_tinyint_arrayAn array of weekdays in which to filter for.
$in_service_bodies_arrayAn array of service bodies in which to filter for.

Definition at line 1466 of file c_comdef_meeting_search_manager.class.php.

References c_comdef_server\GetSquareForRadius(), and c_comdef_server\HuntForRadius().

1469  {
1470  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1471  $loc = array ();
1472 
1473  if ($this->_search_radius_count) {
1474  $this->_search_radius = c_comdef_server::HuntForRadius($this->_search_radius_count, $this->_search_center_long, $this->_search_center_lat, $in_weekday_tinyint_array, $in_service_bodies_array);
1475  $this->_search_radius_count = null;
1476  }
1477 
1478  if ($this->_search_radius > 0) {
1479  $loc = c_comdef_server::GetSquareForRadius($this->_search_radius, $this->_search_center_long, $this->_search_center_lat);
1480  }
1481 
1482  return $loc;
1483  }
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 squ...
static HuntForRadius($in_search_result_count, $in_long_in_degrees, $in_lat_in_degrees, $in_weekday_tinyint_array, $in_service_bodies_array=null)
Find the smallest radius that contains at least the given number of meetings. The way this works is t...
GetStartTime_Max ( )

Get the "starts before" value.

Returns
an integer, containing the epoch time for the value.

Definition at line 843 of file c_comdef_meeting_search_manager.class.php.

844  {
845  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
846  return $this->_start_before;
847  }
$_start_before
An epoch time (seconds, as returned by time()), that denotes the latest starting time allowed...
GetStartTime_Min ( )

Get the "starts after" value.

Returns
an integer, containing the epoch time for the value.

Definition at line 831 of file c_comdef_meeting_search_manager.class.php.

832  {
833  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
834  return $this->_start_after;
835  }
$_start_after
These specify the start time and duration of the meeting. The start time can be specified as a "windo...
& GetWeekdays ( )

Accessor -Get a reference to the $_weekdays field.

Returns
a reference to the $_weekdays field. The key is the weekday (1 = Sunday, 7 = Saturday), and the value is as follows:
  • -1 NOT (exclude all meetings that occur on this weekday from the search).
  • 0 No preference (This weekday will not be a consideration in the search).
  • 1 Return meetings that occur on this weekday.

Default is 0 for all. If no weekdays are specified (either 1 or -1), then the weekday will not be a consideration in the meeting search. If any weekday is specified as 1, then ONLY meetings that occur on the given weekday will be considered in the search, and you must explicitly set any other weekday you wish found.

Definition at line 609 of file c_comdef_meeting_search_manager.class.php.

610  {
611  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
612  return $this->_weekdays;
613  }
SetDuration (   $in_max_duration,
  $in_min_duration = null 
)

Set a duration time window.

Parameters
$in_max_durationAn epoch time, defining the maximum duration of a meeting.
$in_min_durationIf defined, the minimum duration of the meeting.

Definition at line 853 of file c_comdef_meeting_search_manager.class.php.

856  {
857  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
858  $this->_max_duration = $in_max_duration;
859 
860  // We don't let this be less than, or equal to, the start time.
861  if (((null != $in_max_duration) && (null != $in_min_duration)) && intval($in_min_duration) >= intval($in_max_duration)) {
862  $in_min_duration = null;
863  }
864 
865  $this->_min_duration = $in_min_duration;
866  }
SetEndTime (   $in_ends_before)

Set a maximum end time.

Parameters
$in_ends_beforeAn epoch time, defining that the meeting must end no later than this.

Definition at line 806 of file c_comdef_meeting_search_manager.class.php.

808  {
809  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
810  $this->_end_before = $in_ends_before;
811  }
SetFormatsComparisonOperator (   $operator)

Definition at line 1486 of file c_comdef_meeting_search_manager.class.php.

1487  {
1488  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1489  if ($operator == "OR") {
1490  $this->_formats_comparison_operator = "OR";
1491  } else {
1492  $this->_formats_comparison_operator = "AND";
1493  }
1494  }
SetKeyValueSearch (   $in_meeting_key,
  $in_meeting_key_value,
  $in_meeting_key_match_case = false,
  $in_meeting_key_contains = true 
)

Sets a key/value search.

Parameters
$in_meeting_keyA string. This is the exact name of the key to match.
$in_meeting_key_valueA string. The value to match.
$in_meeting_key_match_caseIf true, the case must match. Default is false.
$in_meeting_key_containsIf this is false, then the string must be complete. Default is true (contains).

Definition at line 277 of file c_comdef_meeting_search_manager.class.php.

282  {
283  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
284  $this->_meeting_key = $in_meeting_key;
285  $this->_meeting_key_value = $in_meeting_key_value;
286  $this->_meeting_key_match_case = $in_meeting_key_match_case;
287  $this->_meeting_key_contains = $in_meeting_key_contains;
288  }
SetMeetingIDArray (   $in_meeting_id_array)

Set the current search string.

Parameters
$in_meeting_id_arrayAn array of positive integers. These are the IDs of individual meetings to find.

Definition at line 923 of file c_comdef_meeting_search_manager.class.php.

925  {
926  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
927  $this->_meeting_id_array = $in_meeting_id_array;
928  }
SetPublished (   $in_published_search)

Sets the search for published value.

Definition at line 765 of file c_comdef_meeting_search_manager.class.php.

771  {
772  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
773  $this->_published_search = $in_published_search;
774  }
SetResultsPerPage (   $in_results_per_page)

Accessor -Set the number of results per page. This will only work on the root object.

Returns
a boolean. If the operation was successful, it is true. False otherwise.
Parameters
$in_results_per_pageA positive integer. If it is 0, then all results will be returned in one page.

Definition at line 353 of file c_comdef_meeting_search_manager.class.php.

References $ret.

355  {
356  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
357  $ret = false;
358 
359  if (!$this->_my_root) {
360  $this->_results_per_page = $in_results_per_page;
361  $ret = true;
362  }
363 
364  return $ret;
365  }
$ret
Definition: contact.php:226
SetSearchRadiusAndCenterAuto (   $in_search_result_count,
  $in_long_in_degrees,
  $in_lat_in_degrees 
)

Set a search center, and a count for an auto radius hunt. 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.

Parameters
$in_search_result_countA positive integer. It specifies the number of meetings to find.
$in_long_in_degreesThe longitude needs to be specified in degrees.
$in_lat_in_degreesThe latitude needs to be specified in degrees.

Definition at line 695 of file c_comdef_meeting_search_manager.class.php.

699  {
700  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
701  $this->_search_radius_count = $in_search_result_count;
702  $this->_search_radius = 0;
703  $this->_search_center_long = $in_long_in_degrees;
704  $this->_search_center_lat = $in_lat_in_degrees;
705  }
SetSearchRadiusAndCenterInKm (   $in_search_radius_in_km,
  $in_long_in_degrees,
  $in_lat_in_degrees 
)

Set a search radius and center, with the radius in Km.

Parameters
$in_search_radius_in_kmThe radius needs to be specified in kilometers, not miles.
$in_long_in_degreesThe longitude needs to be specified in degrees.
$in_lat_in_degreesThe latitude needs to be specified in degrees.

Definition at line 666 of file c_comdef_meeting_search_manager.class.php.

670  {
671  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
672  $this->_search_radius = $in_search_radius_in_km;
673  $this->_search_center_long = $in_long_in_degrees;
674  $this->_search_center_lat = $in_lat_in_degrees;
675  }
SetSearchRadiusAndCenterInMiles (   $in_search_radius_in_miles,
  $in_long_in_degrees,
  $in_lat_in_degrees 
)

Set a search radius and center, with the Radius in miles.

Parameters
$in_search_radius_in_milesThe radius as specified in miles, not Km.
$in_long_in_degreesThe longitude needs to be specified in degrees.
$in_lat_in_degreesThe latitude needs to be specified in degrees.

Definition at line 653 of file c_comdef_meeting_search_manager.class.php.

657  {
658  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
659  $this->SetSearchRadiusAndCenterInKm(1.609344 * $in_search_radius_in_miles, $in_long_in_degrees, $in_lat_in_degrees);
660  }
SetSearchRadiusAndCenterInKm($in_search_radius_in_km, $in_long_in_degrees, $in_lat_in_degrees)
Set a search radius and center, with the radius in Km.
SetSearchString (   $in_search_string,
  $in_all_words = false,
  $in_literal = false 
)

Set a search string.

Parameters
$in_search_stringA string. This is a string for which to search.
$in_all_wordsA Boolean. If this is true, then all of the words in a phrase must be present.
$in_literalA Boolean. If this is true, then the spelling must be literal.

Definition at line 896 of file c_comdef_meeting_search_manager.class.php.

900  {
901  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
902  $this->_search_string = $in_search_string;
903  $this->_search_string_all_words = $in_all_words;
904  $this->_search_string_literal = $in_literal;
905  }
SetSort (   $in_sort_fields_array = null,
  $in_desc = false,
  $in_max_sort_keys = 0 
)

Sets up the sort array and direction. This replaces the entire array and direction. If the array is longer than the maximum number of sort keys, only that number of keys are used.

It will reset the sort direction, so you need to explicitly indicate the sort direction if you want it descending, as opposed to ascending.

Parameters
$in_descIf this is set to true, the sort will be highest to lowest. Default is false.
$in_max_sort_keysA positive integer, specifying a new maximum sort depth. If it is not specified, the max will not be changed.

Definition at line 1372 of file c_comdef_meeting_search_manager.class.php.

1379  {
1380  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1381  // Only the root can do this.
1382  if (null == $this->_my_root) {
1383  if (false != $in_desc) {
1384  $in_desc = true;
1385  }
1386 
1387  $this->sort_desc = $in_desc;
1388 
1389  if (0 < $in_max_sort_keys) {
1390  $this->sort_depth = $in_max_sort_keys;
1391  }
1392 
1393  if (null != $in_sort_fields_array) {
1394  $max = min($this->sort_depth, count($in_sort_fields_array));
1395 
1396  if ($max > 0) {
1397  $this->sort_array = array_slice($in_sort_fields_array, 0, $max);
1398  } else {
1399  $this->sort_array = null;
1400  }
1401  }
1402  }
1403  }
SetSortByDistance (   $in_sort_search_by_distance = false)

Sets the sort by distance flag.

Parameters
$in_sort_search_by_distanceA Boolean. False is default.

Definition at line 294 of file c_comdef_meeting_search_manager.class.php.

296  {
297  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
298  $this->_sort_search_by_distance = ($in_sort_search_by_distance != false);
299  }
SetSortDepth (   $in_new_depth = 0)

Accessor. Set the maximum number of sorts to maintain. If the current number is more than the new value, then we remove any beyond that.

Parameters
$in_new_depthA positive integer. If nothing is provided, we set to endless (0).

Definition at line 1290 of file c_comdef_meeting_search_manager.class.php.

1292  {
1293  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1294  // Only the root can do this.
1295  if (null == $this->_my_root) {
1296  $this->sort_depth = $in_new_depth;
1297  if (0 < $this->sort_depth) { // Only if a depth is defined.
1298  while (count($this->sort_array) > $this->sort_depth) {
1299  array_shift($this->sort_array); // Take off the bottommost one.
1300  }
1301  }
1302 
1303  // Force a new sort, based on the new depth.
1304  $this->SortMeetingObjects();
1305  }
1306  }
SortMeetingObjects($in_sort_fields_array=null, $in_desc=null)
Sorts the meetings. This will apply a sort, dependent upon the given fields. The given array contains...
SetStartTime (   $in_starts_after,
  $in_starts_before = null 
)

Set a start time window.

Parameters
$in_starts_afterAn epoch time, defining when the meeting should start (or after)
$in_starts_beforeIf defined, the meeting must start no later than this.

Definition at line 780 of file c_comdef_meeting_search_manager.class.php.

783  {
784  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
785  $this->_start_after = $in_starts_after;
786 
787  // We don't let this be less than, or equal to, the start time.
788  if ((null != $in_starts_after) && (null != $in_starts_before)
789  && (intval($in_starts_after) >= intval($in_starts_before))) {
790  $in_starts_before = null;
791  }
792 
793  // We don't let this be less than, or equal to, the start time.
794  if ((null != $in_starts_after) && (null != $in_starts_before)
795  && (intval($in_starts_after) >= intval($in_starts_before))) {
796  $in_starts_before = null;
797  }
798 
799  $this->_start_before = $in_starts_before;
800  }
SetTopSortPriority (   $in_new_top_sort_key,
  $in_desc = false 
)

Set a new "top" sort priority.

The prior "top" sort priority will be made secondary. If the key was previously "lower" in the sort priority, it is removed from there.

It will trigger a sort after the new key has been established.

This allows a very "natural" type of sorting, where the user goes from one field to another.

This will always reset the sort direction to the given one (or will reset to ascending). We could save the direction with each column, but that is likely to result in a confusing mess. It's a better idea to just apply the same direction to every column.

Parameters
$in_new_top_sort_keyA string. This should be the database table column name for the new "top" sort key.
$in_descIf this is set to true, the sort will be highest to lowest. Default is false.

Definition at line 1325 of file c_comdef_meeting_search_manager.class.php.

1328  {
1329  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1330  // Only the root can do this.
1331  if (null == $this->_my_root) {
1332  // We first remove any previous mention of this key.
1333  for ($i = 0; $i < count($this->sort_array); $i++) {
1334  if ($this->sort_array[$i] == $in_new_top_sort_key) {
1335  unset($this->sort_array[$i]);
1336  break;
1337  }
1338  }
1339 
1340  // The new key goes in as the first item.
1341  if (!is_array($this->sort_array) || (1 > count($this->sort_array))) {
1342  $this->sort_array = array( $in_new_top_sort_key );
1343  } else {
1344  // We first see if we are at the limit for sort depth.
1345 
1346  if (0 < $this->sort_depth) { // Only if a depth is defined.
1347  while (count($this->sort_array) >= $this->sort_depth) {
1348  array_shift($this->sort_array); // Take off the bottommost one.
1349  }
1350  }
1351 
1352  array_unshift($this->sort_array, $in_new_top_sort_key);
1353  }
1354 
1355  // Make sure the new array direction is recorded.
1356  $this->sort_desc = $in_desc;
1357 
1358  // Force a new sort.
1359  $this->SortMeetingObjects();
1360  }
1361  }
SortMeetingObjects($in_sort_fields_array=null, $in_desc=null)
Sorts the meetings. This will apply a sort, dependent upon the given fields. The given array contains...
SetUpFormats ( )

Sets an internal array of integers, containing the Shared IDs for all available formats on the server. They are initialized to 0 (neutral).

Definition at line 231 of file c_comdef_meeting_search_manager.class.php.

232  {
233  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
234  $this->_formats = null;
235 
236  $formats = $this->GetAvailableFormats();
237 
238  // Basic error checking.
239  if (is_array($formats) && count($formats)) {
240  // We look in the server's local language (in case there are no other translations).
241  $my_lang = $this->_my_server->GetLocalLang();
242 
243  $er = $formats[$my_lang];
244 
245  if (is_array($er) && count($er)) {
246  foreach ($er as $key => $value) { // We ignore the value.
247  $this->_formats[$key] = 0;
248  }
249  }
250  }
251  }
GetAvailableFormats()
Returns a multi-dimensional array of references to c_comdef_format objects.
SetUpLanguages ( )

Sets up an internal array of languages. The array uses the language enum as the key, and the -1->0->1 form as the selector.

Definition at line 558 of file c_comdef_meeting_search_manager.class.php.

559  {
560  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
561  $this->_languages = null;
562 
563  // Basic error checking.
564  if ($this->_my_server instanceof c_comdef_server) {
565  $langs = $this->_my_server->GetServerLangs();
566 
567  if (is_array($langs) && count($langs)) {
568  foreach ($langs as $key => $value) {
569  $this->_languages[$key] = 0;
570  }
571  }
572  }
573  }
This class is the main server class. It instantiates a PDO database object, and is the starting point...
SetUpServiceBodies ( )

Sets an internal array of integers, containing the IDs for all available service bodies on the server. They are initialized to 0 (neutral).

Definition at line 307 of file c_comdef_meeting_search_manager.class.php.

308  {
309  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
310  $this->_service_bodies = array();
311 
312  // Basic error checking.
313  if ($this->_my_server instanceof c_comdef_server) {
314  // Start by getting the service bodies aggregator object.
315  $bodies = $this->_my_server->GetServiceBodyArray();
316  if (is_array($bodies) && count($bodies)) {
317  foreach ($bodies as $body) {
318  $key = $body->GetID();
319  $this->_service_bodies[$key] = 0;
320  }
321  }
322  }
323  }
This class is the main server class. It instantiates a PDO database object, and is the starting point...
SortMeetingObjects (   $in_sort_fields_array = null,
  $in_desc = null 
)

Sorts the meetings. This will apply a sort, dependent upon the given fields. The given array contains the field names (SQL columns and keys) for the data to be sorted.

If you don't specify any parameters, the ones from the last sort will be used.

Parameters
$in_descIf this is set to true, the sort will be highest to lowest. Default is false.

Definition at line 1415 of file c_comdef_meeting_search_manager.class.php.

1420  {
1421  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
1422  // Only the root can do this.
1423  if (null == $this->_my_root) {
1424  if (null != $this->_search_results) {
1425  if (null != $in_sort_fields_array) {
1426  $this->sort_array = $in_sort_fields_array;
1427  } else {
1428  $in_sort_fields_array = $this->sort_array;
1429  }
1430 
1431  if (null != $in_desc) {
1432  $this->sort_desc = $in_desc;
1433  } else {
1434  $in_desc = $this->sort_desc;
1435  }
1436 
1437  if (is_array($in_sort_fields_array) && count($in_sort_fields_array)) {
1438  // This is simply a "pass-through" to the object we have on hand.
1439  $this->_search_results->SortMeetingObjects($in_sort_fields_array, $in_desc, $this->_sort_search_by_distance);
1440  }
1441  }
1442  }
1443  }
$sort_array
This contains an array of strings that represent the sort keys.
$sort_desc
This is set to true if the sort is a reverse sort.
StringSearchForAllWords ( )

Get the current search string "all words" flag.

Definition at line 946 of file c_comdef_meeting_search_manager.class.php.

947  {
948  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
950  }
$_search_string_all_words
A Boolean. If this is true, then all of the words in a phrase must be present.
StringSearchIsLiteral ( )

Get the current search string literal flag.

Definition at line 956 of file c_comdef_meeting_search_manager.class.php.

957  {
958  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
960  }
$_search_string_literal
A Boolean. If this is true, then the spelling must be literal.

Member Data Documentation

$_end_before = null
protected

An epoch time (seconds, as returned by time()), that denotes the latest ending time allowed.

Definition at line 107 of file c_comdef_meeting_search_manager.class.php.

$_formats = null
protected

These fields are used to specify the search criteria.

An array of integers. These are formats. The filtering will be an "AND" filtering, so qualified meetings must have all of the given formats. The key is the format's shared ID, and the value will be one of these:

  • -1 NOT (exclude all meetings that contain this format from the search).
  • 0 No preference (This format will not be a consideration in the search).
  • 1 Return meetings that contain this format.

Default is 0 for all. If no formats are specified (either 1 or -1), then formats will not be a consideration in the meeting search. If any format is specified as 1, then ONLY meetings with the given format will be considered in the search, and you must explicitly set any other formats you wish found.

Definition at line 63 of file c_comdef_meeting_search_manager.class.php.

$_formats_comparison_operator = "AND"
protected

A string, controls the comparison operator used for included formats. Valid values are AND and OR.

Definition at line 73 of file c_comdef_meeting_search_manager.class.php.

$_languages = null
protected

An array of integers. The key is the language enum, and the value is as follows:

  • -1 NOT (exclude all meetings that have this language from the search).
  • 0 No preference (This language will not be a consideration in the search).
  • 1 Return meetings that have this language.

Default is 0 for all. If no languages are specified (either 1 or -1), then language will not be a consideration in the meeting search. If any language is specified as 1, then ONLY meetings with the given language will be considered in the search, and you must explicitly set any other language you wish found.

Definition at line 85 of file c_comdef_meeting_search_manager.class.php.

$_max_duration = null
protected

The number of seconds a meeting can last, at most.

Definition at line 109 of file c_comdef_meeting_search_manager.class.php.

$_meeting_id_array = null
protected

This contains a list of IDs of individual meetings. If it is set, then all other search parameters are ignored.

An array of positive integers. The Ids of meetings to find. If this is set, all other search criteria are ignored.

Definition at line 135 of file c_comdef_meeting_search_manager.class.php.

$_meeting_key = null
protected

This allows you to filter out a particular value for a key.

A string. This is the xact name of the key to match. NOTE: As of Version 1.5, this can be an array of strings (it can still be a single string). The array should contain the names of string fields.

Definition at line 123 of file c_comdef_meeting_search_manager.class.php.

$_meeting_key_contains = false
protected

If this is false, then the string must be complete. Default is false (literal).

Definition at line 132 of file c_comdef_meeting_search_manager.class.php.

$_meeting_key_match_case = false
protected

If true, the case must match. Default is false. NOTE: As of Version 1.5, setting this to TRUE also stops the metaphone search.

Definition at line 129 of file c_comdef_meeting_search_manager.class.php.

$_meeting_key_value = null
protected

A string. The value to match. NOTE: As of Version 1.5, this is matched with a metaphone match, as well as the RegEx match.

Definition at line 126 of file c_comdef_meeting_search_manager.class.php.

$_min_duration = null
protected

The number of seconds a meeting should last as a minimum.

Definition at line 108 of file c_comdef_meeting_search_manager.class.php.

$_my_root = null
private

If this isn't the root, then this will be a reference to the root.

A reference to an instance of c_comdef_meeting_search_manager -The root object.

Definition at line 157 of file c_comdef_meeting_search_manager.class.php.

$_my_server = null
private

A reference to a c_comdef_server object. This is the server to be used for the search.

Definition at line 159 of file c_comdef_meeting_search_manager.class.php.

$_pageno = 0
private

An integer. The page number represented by this object. If $_results_per_page is 0, this is ignored.

Definition at line 154 of file c_comdef_meeting_search_manager.class.php.

$_published_search = 0
protected

This indicates whether the search should include, exclude, or focus on "published" meetings.

This only counts if the searcher is a logged-in admin. The value can be:

  • -1 Search for ONLY unpublished meetings
  • 0 Search for published and unpublished meetings.
  • 1 Search for ONLY published meetings.

Definition at line 138 of file c_comdef_meeting_search_manager.class.php.

$_results_per_page = 0
private

This refers to portions of a larger search (pages).

The number of meetings to list per page.

Definition at line 153 of file c_comdef_meeting_search_manager.class.php.

$_search_center_lat = null
protected

If $_search_radius is not null, this needs to be a floating-point number that indicates the latitude, in degrees, of the search center.

Definition at line 115 of file c_comdef_meeting_search_manager.class.php.

$_search_center_long = null
protected

If $_search_radius is not null, this needs to be a floating-point number that indicates the longitude, in degrees, of the search center.

Definition at line 114 of file c_comdef_meeting_search_manager.class.php.

$_search_radius = null
protected

These specify the search radius (We store it in kilometers).

If this is not null, it needs to be a positive, floating-point number, indicating the radius, in Kilometers.

Definition at line 112 of file c_comdef_meeting_search_manager.class.php.

$_search_radius_count = null
protected

If this is not null, it needs to be a positive integer, indicating the number of meetings to find automatically.

Definition at line 113 of file c_comdef_meeting_search_manager.class.php.

$_search_results = null
protected

This contains the search results.

A c_comdef_meetings object. If this is null, a new search is performed. This contains the entire search results.

Definition at line 146 of file c_comdef_meeting_search_manager.class.php.

$_search_string = null
protected

We allow a broad string search that goes through all the text items. In English and Spanish, it uses metaphone, which is a "sounds like" phonetic search.

A string to be located from within the results. This search is done after all of the previous ones. This is applied at the end.

Definition at line 118 of file c_comdef_meeting_search_manager.class.php.

$_search_string_all_words = false
protected

A Boolean. If this is true, then all of the words in a phrase must be present.

Definition at line 119 of file c_comdef_meeting_search_manager.class.php.

$_search_string_literal = false
protected

A Boolean. If this is true, then the spelling must be literal.

Definition at line 120 of file c_comdef_meeting_search_manager.class.php.

$_service_bodies = null
protected

An array of integers. The key is the ID for a Service Body, and the value is one of these:

  • -1 NOT (exclude all meetings that contain this Service Body from the search).
  • 0 No preference (This Service Body will not be a consideration in the search).
  • 1 Return meetings that contain this Service Body.

Default is 0 for all. If no Service Bodies are specified (either 1 or -1), then Service Bodies will not be a consideration in the meeting search. If any Service Body is specified as 1, then ONLY meetings with the given Service Body will be considered in the search, and you must explicitly set any other Service Bodies you wish found.

Definition at line 76 of file c_comdef_meeting_search_manager.class.php.

$_sort_search_by_distance = false
protected

If this is true, then the search results may be sorted by distance from the geo center.

Definition at line 143 of file c_comdef_meeting_search_manager.class.php.

$_start_after = null
protected

These specify the start time and duration of the meeting. The start time can be specified as a "window.".

An epoch time (seconds, as returned by time()), that denotes the earliest starting time allowed.

Definition at line 105 of file c_comdef_meeting_search_manager.class.php.

$_start_before = null
protected

An epoch time (seconds, as returned by time()), that denotes the latest starting time allowed.

Definition at line 106 of file c_comdef_meeting_search_manager.class.php.

$_weekdays = null
protected

An array of integers. The key is the weekday (1 = Sunday, 7 = Saturday), and the value is as follows:

  • -1 NOT (exclude all meetings that occur on this weekday from the search).
  • 0 No preference (This weekday will not be a consideration in the search).
  • 1 Return meetings that occur on this weekday.

Default is 0 for all. If no weekdays are specified (either 1 or -1), then the weekday will not be a consideration in the meeting search. If any weekday is specified as 1, then ONLY meetings that occur on the given weekday will be considered in the search, and you must explicitly set any other weekday you wish found.

Definition at line 94 of file c_comdef_meeting_search_manager.class.php.

$sort_array = null
private

This contains an array of strings that represent the sort keys.

Definition at line 148 of file c_comdef_meeting_search_manager.class.php.

$sort_depth = 3
private

An integer. This is how far back a staged sort goes. Default is 3. 0 is forever.

Definition at line 150 of file c_comdef_meeting_search_manager.class.php.

$sort_desc = false
private

This is set to true if the sort is a reverse sort.

Definition at line 149 of file c_comdef_meeting_search_manager.class.php.


The documentation for this class was generated from the following file: