Public Member Functions | |
__toString () | |
get_address_point ($country_id=NULL, $town_id=NULL, $street_id=NULL, $street_number=NULL, $gpsx=NULL, $gpsy=NULL) | |
Check if address point exists. | |
get_all_address_points ($limit_from=0, $limit_results=50, $order_by= 'id', $order_by_direction= 'asc', $member_id=NULL, $filter_sql= '') | |
Returns all address points. | |
count_all_address_points ($member_id=NULL, $filter_sql= '') | |
Counts all address points. | |
count_all_items_by_address_point_id ($address_point_id) | |
Count all items (members or devices) belongs to address point. | |
get_gps_coordinates ($address_point_id=NULL) | |
Get GPS coordinates from given address point. | |
update_gps_coordinates ($address_point_id, $gpsx, $gpsy) | |
Update GPS coordinates in address point. | |
get_all_members () | |
Returns all members on this address point. | |
get_all_devices () | |
Returns all devices on this address point. | |
get_all_gps ($like) | |
Returns all GPS by given like. | |
get_address_point_with_gps_by_street_street_number_town_country ($street_id, $street_number, $town_id, $country_id) | |
Return only 1 address point with GPS by given street, street number, town and country. | |
get_address_point_with_gps_by_country_id_town_district_street_zip ($country_id, $town, $district, $street, $number, $zip) | |
get_all_address_points_with_empty_gps () | |
Returns all address point with empty GPS coords. | |
get_all_address_point_names () | |
Returns all address points with non null name. |
Protected Attributes | |
$has_many = array('members', 'devices') | |
$belongs_to = array('town', 'street', 'country') |
Address_point_Model::__toString | ( | ) |
Address_point_Model::count_all_address_points | ( | $member_id = NULL , |
|
$filter_sql = '' |
|||
) |
Counts all address points.
!!!!!! SECURITY WARNING !!!!!! Be careful when you using this method, param $filter_sql is unprotected for SQL injections, security should be made at controller site using Filter_form class. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
integer | $member_id | Member who use this address point |
string | $filter_sql | Search filter |
Address_point_Model::count_all_items_by_address_point_id | ( | $address_point_id | ) |
Count all items (members or devices) belongs to address point.
integer | $address_point_id |
Address_point_Model::get_address_point | ( | $country_id = NULL , |
|
$town_id = NULL , |
|||
$street_id = NULL , |
|||
$street_number = NULL , |
|||
$gpsx = NULL , |
|||
$gpsy = NULL |
|||
) |
Check if address point exists.
Exists return it with correct ID Not exists create it and set with given values (without GPS) and return it with zero ID
integer | $country_id | |
integer | $town_id | |
integer | $street_id | |
integer | $street_number | |
float | $gpsx | |
float | $gpsy |
Address_point_Model::get_address_point_with_gps_by_street_street_number_town_country | ( | $street_id, | |
$street_number, | |||
$town_id, | |||
$country_id | |||
) |
Return only 1 address point with GPS by given street, street number, town and country.
integer | $street_id | |
integer | $sreet_number | |
integer | $town_id | |
integer | $country_id |
Address_point_Model::get_all_address_point_names | ( | ) |
Returns all address points with non null name.
Address_point_Model::get_all_address_points | ( | $limit_from = 0 , |
|
$limit_results = 50 , |
|||
$order_by = 'id' , |
|||
$order_by_direction = 'asc' , |
|||
$member_id = NULL , |
|||
$filter_sql = '' |
|||
) |
Returns all address points.
!!!!!! SECURITY WARNING !!!!!! Be careful when you using this method, param $filter_sql is unprotected for SQL injections, security should be made at controller site using Filter_form class. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
integer | $limit_from | |
integer | $limit_results | |
string | $order_by | |
string | $order_by_direction | |
integer | $member_id | |
string | $filter_sql |
Address_point_Model::get_all_address_points_with_empty_gps | ( | ) |
Returns all address point with empty GPS coords.
Address_point_Model::get_all_devices | ( | ) |
Returns all devices on this address point.
Address_point_Model::get_all_gps | ( | $like | ) |
Returns all GPS by given like.
string | $like |
Address_point_Model::get_all_members | ( | ) |
Returns all members on this address point.
Address_point_Model::get_gps_coordinates | ( | $address_point_id = NULL | ) |
Get GPS coordinates from given address point.
integer | $address_point_id |
Address_point_Model::update_gps_coordinates | ( | $address_point_id, | |
$gpsx, | |||
$gpsy | |||
) |
Update GPS coordinates in address point.
integer | $address_point_id | |
double | $gpsx | |
double | $gpsy |