Public Member Functions | |
__construct ( $in_db_object=NULL, $in_db_result=NULL, $in_owner_id=NULL, $in_tags_array=NULL, $in_longitude=NULL, $in_latitude=NULL) | |
set_address_elements ( $in_tags, $dont_save=false) | |
set_address_element ( $in_index, $in_value, $dont_save=false) | |
set_address_element_by_key ( $in_key, $in_value, $dont_save=false) | |
get_address_element_by_index ( $in_index) | |
lookup_address () | |
geocode_long_lat () | |
get_readable_address ( $with_venue=true) | |
set_tags_from_address_elements () | |
get_address_elements () | |
Public Member Functions inherited from CO_LL_Location | |
__construct ( $in_db_object=NULL, $in_db_result=NULL, $in_owner_id=NULL, $in_tags_array=NULL, $in_longitude=NULL, $in_latitude=NULL, $in_fuzz_factor=NULL, $in_can_see_through_the_fuzz=NULL) | |
load_from_db ( $in_db_result) | |
update_db () | |
set_longitude ( $in_new_value) | |
set_latitude ( $in_new_value) | |
fuzz_factor () | |
is_fuzzy () | |
set_fuzz_factor ( $in_new_value) | |
raw_longitude () | |
raw_latitude () | |
longitude () | |
latitude () | |
set_can_see_through_the_fuzz ( $in_id) | |
can_see_through_the_fuzz () | |
i_can_see_clearly_now () | |
Public Member Functions inherited from CO_Main_DB_Record | |
__construct ( $in_db_object=NULL, $in_db_result=NULL, $in_owner_id=NULL, $in_tags_array=NULL) | |
set_owner_id ( $in_new_id) | |
set_tags ( $in_tags_array) | |
set_tag ( $in_tag_index, $in_tag_value) | |
get_payload () | |
set_payload ( $in_payload) | |
owner_id () | |
tags () | |
Public Member Functions inherited from A_CO_DB_Table_Base | |
__construct ( $in_db_object=NULL, $in_db_result=NULL) | |
set_batch_mode () | |
clear_batch_mode () | |
id () | |
lock () | |
locked () | |
danger_will_robinson_danger_clear_id () | |
user_can_read () | |
user_can_write () | |
set_read_security_id ($in_new_id) | |
set_write_security_id ($in_new_id) | |
set_name ($in_new_value) | |
delete_from_db () | |
reload_from_db () | |
get_access_object () | |
get_lang () | |
set_lang ( $in_lang_id=NULL) | |
Public Attributes | |
$address_elements = Array() | |
These are the address elements we use for creating lookup addresses. More... | |
$google_geocode_uri_prefix = NULL | |
This is the Geocode URI for the Google Geocode. More... | |
$google_lookup_uri_prefix = NULL | |
This is the lookup URI for the Google reverse Geocode. More... | |
$region_bias = NULL | |
This can be set by subclasses in order to set a region bias. More... | |
Public Attributes inherited from A_CO_DB_Table_Base | |
$class_description | |
This is a description of the class (not the instance). More... | |
$instance_description | |
This is a description that describes the instance. More... | |
$last_access | |
This is a UNIX epoch date that describes the last modification. The default is UNIX Day Two (in case of UTC timezone issues). More... | |
$name | |
This is the "object_name" string field. More... | |
$read_security_id | |
This is a single integer, defining the security ID required to view the record. If it is 0, then it is "open.". More... | |
$write_security_id | |
This is a single integer, defining the required security token to modify the record. If it is 0, then any logged-in user can modify. More... | |
$context | |
This is a mixed associative array, containing fields for the object. More... | |
$error | |
If there is an error, it is contained here, in a LGV_Error instance. More... | |
Protected Member Functions | |
_get_address_element_labels () | |
Protected Member Functions inherited from CO_LL_Location | |
_default_setup () | |
_build_parameter_array () | |
_km_per_degree () | |
_fuzz_me () | |
Protected Member Functions inherited from A_CO_DB_Table_Base | |
_badger_serialize ( $in_data) | |
_badger_unserialize ( $in_data) | |
_write_to_db () | |
_seppuku () | |
Additional Inherited Members | |
Static Public Attributes inherited from CO_Main_DB_Record | |
static | $s_table_name = 'co_data_nodes' |
Protected Attributes inherited from CO_LL_Location | |
$_longitude | |
$_latitude | |
Protected Attributes inherited from CO_Main_DB_Record | |
$_owner_id | |
$_tags | |
Protected Attributes inherited from A_CO_DB_Table_Base | |
$_db_object | |
This is the actual database object that "owns" this instance. It should not be exposed beyond this class or subclasses, thereof. More... | |
$_id | |
This is the within-table unique ID of this record. More... | |
$_batch_mode | |
If this is true, then the write_record call will not be made in update_db. It will be done when clear_batch_mode() is called, instead. More... | |
This is a specialization of the location class. It adds support for US addresses, and uses the first eight tags for this.
Definition at line 46 of file co_place.class.php.
CO_Place::__construct | ( | $in_db_object = NULL , |
|
$in_db_result = NULL , |
|||
$in_owner_id = NULL , |
|||
$in_tags_array = NULL , |
|||
$in_longitude = NULL , |
|||
$in_latitude = NULL |
|||
) |
Constructor (Initializer)
$in_db_object | The database object for this instance. |
$in_db_result | The database row for this instance (associative array, with database keys). |
$in_owner_id | The ID of the object (in the database) that "owns" this instance. |
$in_tags_array | An array of up to 10 strings, with address information in the first 8. Order is important:
|
Associative keys are not used. The array should be in that exact order.
$in_longitude | An initial longitude value. |
$in_latitude | An initial latitude value. |
Reimplemented in CO_US_Place_Collection, CO_US_Place, and CO_Place_Collection.
Definition at line 77 of file co_place.class.php.
References $region_bias, set_address_elements(), and CO_Main_DB_Record\tags().
|
protected |
This fetches string labels to be used as keys for the fixed tags.
Reimplemented in CO_US_Place.
Definition at line 59 of file co_place.class.php.
References CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_0, CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_1, CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_2, CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_3, CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_4, CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_5, CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_6, and CO_CHAMELEON_Lang_Common\$chameleon_co_place_tag_7.
Referenced by geocode_long_lat(), get_address_element_by_index(), get_address_elements(), get_readable_address(), set_address_element(), set_address_element_by_key(), set_address_elements(), and set_tags_from_address_elements().
CO_Place::geocode_long_lat | ( | ) |
This will do a geocode, using the Google Geocode API, of the object's long/lat, and will return the address (in an associative array). This requires that CO_Config::$google_api_key be set to a valid API key with the Google Geocode service enabled.
Definition at line 260 of file co_place.class.php.
References CO_CHAMELEON_Lang_Common\$co_place_error_code_failed_to_geocode, CO_CHAMELEON_Lang\$co_place_error_desc_failed_to_geocode, CO_CHAMELEON_Lang\$co_place_error_name_failed_to_geocode, _get_address_element_labels(), CO_Chameleon_Utils\call_curl(), CO_LL_Location\raw_latitude(), and CO_LL_Location\raw_longitude().
CO_Place::get_address_element_by_index | ( | $in_index | ) |
$in_index | The 0-based index we're looking for. |
Definition at line 213 of file co_place.class.php.
References _get_address_element_labels().
CO_Place::get_address_elements | ( | ) |
Reimplemented in CO_US_Place.
Definition at line 435 of file co_place.class.php.
References _get_address_element_labels().
CO_Place::get_readable_address | ( | $with_venue = true | ) |
$with_venue | If false, then only the street address/town/state/nation will be displayed. That makes this better for geocoding. Default is true. |
Definition at line 343 of file co_place.class.php.
References _get_address_element_labels().
Referenced by lookup_address().
CO_Place::lookup_address | ( | ) |
This will do a reverse geocode, using the Google Geocode API, of the object's address, and will return the long/lat (in an associative array). This requires that CO_Config::$google_api_key be set to a valid API key with the Google Geocode service enabled.
Definition at line 234 of file co_place.class.php.
References CO_CHAMELEON_Lang_Common\$co_place_error_code_failed_to_lookup, CO_CHAMELEON_Lang\$co_place_error_desc_failed_to_lookup, CO_CHAMELEON_Lang\$co_place_error_name_failed_to_lookup, CO_Chameleon_Utils\call_curl(), and get_readable_address().
CO_Place::set_address_element | ( | $in_index, | |
$in_value, | |||
$dont_save = false |
|||
) |
This sets the indexed address_element property, as per the provided string. This can also update the tag.
$in_index | The 0-based index of the value to set. |
$in_value | The value to set to the address element string. |
$dont_save | If true, then the DB update will not be called. |
Definition at line 159 of file co_place.class.php.
References _get_address_element_labels(), and CO_LL_Location\update_db().
Referenced by set_address_element_by_key(), and set_address_elements().
CO_Place::set_address_element_by_key | ( | $in_key, | |
$in_value, | |||
$dont_save = false |
|||
) |
This sets the address_element property, as per the provided string, and indexed by the associative key. This can also update the tag.
$in_key | The string, with the element key. |
$in_value | The value to set to the address element string. |
$dont_save | If true, then the DB update will not be called. |
Definition at line 190 of file co_place.class.php.
References _get_address_element_labels(), and set_address_element().
CO_Place::set_address_elements | ( | $in_tags, | |
$dont_save = false |
|||
) |
This sets the address_elements property, as per the provided array of strings. This can also update the tags.
$in_tags | An array of up to 8 strings, with the new address information. Order is important:
|
Associative keys are not used. The array should be in that exact order.
$dont_save | If true, then the DB update will not be called. |
Definition at line 115 of file co_place.class.php.
References _get_address_element_labels(), set_address_element(), test_is_assoc(), and CO_LL_Location\update_db().
Referenced by __construct().
CO_Place::set_tags_from_address_elements | ( | ) |
This updates the tags (and saves them to the DB) as per our internal address_elements property.
Definition at line 419 of file co_place.class.php.
References _get_address_element_labels(), and CO_Main_DB_Record\set_tags().
CO_Place::$address_elements = Array() |
These are the address elements we use for creating lookup addresses.
Definition at line 47 of file co_place.class.php.
CO_Place::$google_geocode_uri_prefix = NULL |
This is the Geocode URI for the Google Geocode.
Definition at line 48 of file co_place.class.php.
CO_Place::$google_lookup_uri_prefix = NULL |
This is the lookup URI for the Google reverse Geocode.
Definition at line 49 of file co_place.class.php.
CO_Place::$region_bias = NULL |
This can be set by subclasses in order to set a region bias.
Definition at line 50 of file co_place.class.php.
Referenced by __construct().