FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
Address_point_Model Class Reference
Inheritance diagram for Address_point_Model:
ORM

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')

Member Function Documentation

Address_point_Model::__toString ( )
Author
Ondrej Fibich
Returns
string reprezentation of address point
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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Author
Michal Kliment, Ondřej Fibich
Parameters
integer$member_idMember who use this address point
string$filter_sqlSearch filter
Returns
integer Count of all address points
Address_point_Model::count_all_items_by_address_point_id (   $address_point_id)

Count all items (members or devices) belongs to address point.

Author
Michal Kliment
Parameters
integer$address_point_id
Returns
integer
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

Author
Michal Kliment
Parameters
integer$country_id
integer$town_id
integer$street_id
integer$street_number
float$gpsx
float$gpsy
Returns
Address_point_Model
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.

Author
Michal Kliment
Parameters
integer$street_id
integer$sreet_number
integer$town_id
integer$country_id
Returns
Address_point_Model
Address_point_Model::get_all_address_point_names ( )

Returns all address points with non null name.

Author
Michal Kliment
Returns
MySQL Iterator object
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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Author
Michal Kliment
Parameters
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
integer$member_id
string$filter_sql
Returns
Mysql_Result
Address_point_Model::get_all_address_points_with_empty_gps ( )

Returns all address point with empty GPS coords.

Author
Michal Kliment
Returns
Mysql_Result object
Address_point_Model::get_all_devices ( )

Returns all devices on this address point.

Author
Michal Kliment
Returns
Mysql_Result
Address_point_Model::get_all_gps (   $like)

Returns all GPS by given like.

Author
Michal Kliment
Parameters
string$like
Returns
MySQL_Result
Address_point_Model::get_all_members ( )

Returns all members on this address point.

Author
Michal Kliment
Returns
Mysql_Result
Address_point_Model::get_gps_coordinates (   $address_point_id = NULL)

Get GPS coordinates from given address point.

Author
Ondřej Fibich
Parameters
integer$address_point_id
Returns
object GPS separated to x and y part to fields named as: gpsx, gpsy
Address_point_Model::update_gps_coordinates (   $address_point_id,
  $gpsx,
  $gpsy 
)

Update GPS coordinates in address point.

Author
Ondřej Fibich
Parameters
integer$address_point_id
double$gpsx
double$gpsy
Returns
boolean

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