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

A class to hold a collection of c_comdef_meeting objects. More...

List of all members.

Public Member Functions

 __construct ($in_parent_obj, $in_meetings_data)
 Constructor.
 RemoveInvalidMeetings ()
 Run through the list, and remove meetings that do not show up as "valid.".
 SetParentObj ($in_parent_obj)
 Set the parent object of this instance.
 GetParentObj ()
 Return a reference to the parent object of this instance.
 GetNumMeetings ()
 Get the number of meetings.
GetMeetingObjects ()
 Accessor -Get the meetings array.
GetFormatsUsed ()
 Accessor -Get the formats array.
GetServiceBodiesUsed ()
 Accessor -Get the service bodies array.
 GetMeetingTableName ()
 RemoveMeeting ($in_id)
 Removes a meeting by a given ID from the set.
 GetMeetingsByDistance ($in_longitude, $in_latitude, $in_radius, $in_radius_is_km=true, $in_sort_by_distance=false)
 Return all the meetings that are within a certain radius of the given location.
 GetMeetingsByKeyValue ($in_key_string_array, $in_value, $in_contains=true, $in_match_case=false)
 Return all the meetings that have a given key value.
 GetMeetingsByString ($in_string, $in_lang_enum=null, $in_all_words_bool=false, $in_literal=false)
 Return all the meetings that contain the given string.
 GetMeetingKeys ()
 Returns an array of all the field keys used by the meetings in this search set.
 SortMeetingObjects ($in_sort_fields_array, $in_desc=false, $in_by_distance=false)
 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.
 GetSortKey ()
 GetSortDir ()

Static Public Member Functions

static IsInDistance ($lat1, $lon1, $lat2, $lon2, $in_distance_in_KM, &$out_dist_in_KM)
 Uses the Vincenty calculation to estimate a distance between the two given lat/long pairs, then returns true or false as to whether or not the distance between them falls within the given distance (in KM).
static GetDistance ($lat1, $lon1, $lat2, $lon2)
 Uses the Vincenty calculation to estimate a distance between the two given lat/long pairs, then returns true or false as to whether or not the distance between them falls within the given distance (in KM).
static SortDistanceKernel ($object_a, $object_b)
 This is the standard PHP sort callback used in the sort loops for distance. This will not be effective if the meetings don't both have _distance_in_km fields.
static SortKernel ($object_a, $object_b)
 This is the standard PHP sort callback used in the sort loops.

Private Member Functions

 CreateMeetingObjects ($in_meetings_data)
 Create a bunch of meeting objects from the given data.

Private Attributes

 $_local_id_parent_obj = null
 A reference to the "parent" object for this instance.
 $_meetings_objects = null
 An array of new c_comdef_meeting objects that comprises the content.
 $_formats_used = null
 An array of references to the c_comdef_format objects that are used in this dataset.
 $_service_bodies_used = null
 An array of references to the c_comdef_service_body objects that are used in this dataset.
 $_sort_key = null
 An array of string. This is used during sorting, to indicate which key is being sorted.
 $_sort_dir = null
 $_sort_search_by_distance = false
 This is true if the meetings have a distance by which they can be sorted, and the sort should be done with it.

Detailed Description

A class to hold a collection of c_comdef_meeting objects.


Constructor & Destructor Documentation

c_comdef_meetings::__construct ( in_parent_obj,
in_meetings_data 
)

Constructor.


Member Function Documentation

c_comdef_meetings::CreateMeetingObjects ( in_meetings_data) [private]

Create a bunch of meeting objects from the given data.

Parameters:
in_meetings_dataAn array of data for one meeting.
static c_comdef_meetings::GetDistance ( lat1,
lon1,
lat2,
lon2 
) [static]

Uses the Vincenty calculation to estimate a distance between the two given lat/long pairs, then returns true or false as to whether or not the distance between them falls within the given distance (in KM).

Returns:
a Float with the distance, in kilometers.
Parameters:
lat1These four parameters are the given two points long/lat, in degrees.

Referenced by c_comdef_server::GetMeetings().

& c_comdef_meetings::GetFormatsUsed ( )

Accessor -Get the formats array.

Returns:
a reference to the array that references the c_comdef_format objects used within this dataset.
c_comdef_meetings::GetMeetingKeys ( )

Returns an array of all the field keys used by the meetings in this search set.

Returns:
an array of strings, with the key being the same as the value. This reflects
& c_comdef_meetings::GetMeetingObjects ( )

Accessor -Get the meetings array.

Returns:
a reference to the internal meetings object array.
c_comdef_meetings::GetMeetingsByDistance ( in_longitude,
in_latitude,
in_radius,
in_radius_is_km = true,
in_sort_by_distance = false 
)

Return all the meetings that are within a certain radius of the given location.

Returns:
a new c_comdef_meetings object, containing the subset of meetings that are within the radius. Null if nothing found.
Parameters:
in_longitudeFloating-point. The longitude value of the center point.
in_latitudeFloating-point. The latitude value of the center point.
in_radiusFloating-point. The radius from the center
in_radius_is_kmBoolean. Set this to false if the radius is in miles (default is true).
in_sort_by_distanceBoolean. Set this to true to sort the results by distance.
c_comdef_meetings::GetMeetingsByKeyValue ( in_key_string_array,
in_value,
in_contains = true,
in_match_case = false 
)

Return all the meetings that have a given key value.

Use this to filter for meetings within a single key/value.

Returns:
a new c_comdef_meetings object, containing the subset of meetings that contain the search query. Null if nothing found.
Parameters:
in_key_string_arrayThis is data item keys (an array of string). These must match exactly.
in_valueThis is a string with a literal value to find.
in_containsIf this is false, then the entire value must match (Defalt is true).
in_match_caseIf this is true, then the case must match (Default is false). NOTE: As of Version 1.5, the behavior has changed. This now refers to using metaphone or not. If it is true, the the string must match exactly, including case. However, if it is false, a case-insensitive metaphone search is done in the native server language.
c_comdef_meetings::GetMeetingsByString ( in_string,
in_lang_enum = null,
in_all_words_bool = false,
in_literal = false 
)

Return all the meetings that contain the given string.

If the language is English or Spanish, this does a metaphone search of all all the strings in the "en" or "es" formats and weekdays. If it is any other language, then a simple string search is performed.

Returns:
a new c_comdef_meetings object, containing the subset of meetings that contain the search query. Null if nothing found.

If no language is given, we use the server's native language.

We force the search to happen in lowercase. This is a very basic search.

If we will use metaphone, we convert our search criteria to metaphone keys.

Parameters:
in_stringThis is the string to search for.
in_lang_enumThis is the code for the desired language. If not given, the server localization will be used.
in_all_words_boolIf true, then all the words in the given search term need to be found (They could be distributed all around the various components of the meeting record).
in_literalIf this is set to true, then metaphone-capable languages will not use metaphone, and will literally test the strings. Default is false.
c_comdef_meetings::GetMeetingTableName ( )

Returns the name of the Meeting Table.

Returns:
the name of the meetings table.
c_comdef_meetings::GetNumMeetings ( )

Get the number of meetings.

Returns:
an integer, containing the number of meeting objects in the internal meetings object array.
c_comdef_meetings::GetParentObj ( )

Return a reference to the parent object of this instance.

Returns:
a reference to the parent instance of the object.

Implements i_comdef_has_parent.

& c_comdef_meetings::GetServiceBodiesUsed ( )

Accessor -Get the service bodies array.

Returns:
a reference to the array that references the c_comdef_service_body objects used within this dataset.
c_comdef_meetings::GetSortDir ( )
c_comdef_meetings::GetSortKey ( )
static c_comdef_meetings::IsInDistance ( lat1,
lon1,
lat2,
lon2,
in_distance_in_KM,
&$  out_dist_in_KM 
) [static]

Uses the Vincenty calculation to estimate a distance between the two given lat/long pairs, then returns true or false as to whether or not the distance between them falls within the given distance (in KM).

Returns:
a Boolean. true, if the points are within the distance given.
Parameters:
lat1These four parameters are the given two points long/lat, in degrees.
in_distance_in_KMThe distance they must be within to return true (in Kilometers).
out_dist_in_KMThis is an optional field that allows the calculated distance to be returned (in KM).
c_comdef_meetings::RemoveInvalidMeetings ( )

Run through the list, and remove meetings that do not show up as "valid.".

If a user is logged in, they see dead meetings.

c_comdef_meetings::RemoveMeeting ( in_id)

Removes a meeting by a given ID from the set.

Parameters:
in_idInteger: the id_bigint for the meeting to be removed.
c_comdef_meetings::SetParentObj ( in_parent_obj)

Set the parent object of this instance.

Parameters:
in_parent_objA reference to the parent object.

Implements i_comdef_has_parent.

static c_comdef_meetings::SortDistanceKernel ( object_a,
object_b 
) [static]

This is the standard PHP sort callback used in the sort loops for distance. This will not be effective if the meetings don't both have _distance_in_km fields.

static c_comdef_meetings::SortKernel ( object_a,
object_b 
) [static]

This is the standard PHP sort callback used in the sort loops.

c_comdef_meetings::SortMeetingObjects ( in_sort_fields_array,
in_desc = false,
in_by_distance = false 
)

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.

Parameters:
in_sort_fields_arrayAn array of strings. The array will deliniate the sort order, by field name. Array element [0] will be the highest priority, and it will descend from there.
in_descIf this is set to true, the sort will be highest to lowest. Default is false.
in_by_distanceIf true, then, after the regular sort, we sort by distance (May be ignored if the meetings don't have a

Member Data Documentation

c_comdef_meetings::$_formats_used = null [private]

An array of references to the c_comdef_format objects that are used in this dataset.

c_comdef_meetings::$_local_id_parent_obj = null [private]

A reference to the "parent" object for this instance.

c_comdef_meetings::$_meetings_objects = null [private]

An array of new c_comdef_meeting objects that comprises the content.

c_comdef_meetings::$_service_bodies_used = null [private]

An array of references to the c_comdef_service_body objects that are used in this dataset.

c_comdef_meetings::$_sort_dir = null [private]

A string. This is used during sorting, to indicate which direction to take for the sort. It is either:

  • "asc" -Ascending
  • "desc" -Descending
c_comdef_meetings::$_sort_key = null [private]

An array of string. This is used during sorting, to indicate which key is being sorted.

c_comdef_meetings::$_sort_search_by_distance = false [private]

This is true if the meetings have a distance by which they can be sorted, and the sort should be done with it.


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