@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | |
15 | 15 | // Get random route from test routes |
16 | 16 | //-------------------------------------------------------- |
17 | - $route=new Route(); |
|
17 | + $route = new Route(); |
|
18 | 18 | |
19 | - $route_id=$route->getRandomRouteId(0, 10); |
|
19 | + $route_id = $route->getRandomRouteId(0, 10); |
|
20 | 20 | |
21 | 21 | if (is_null($route_id)) { |
22 | 22 | echo "can't retrieve random route_id!.. Try again."; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | |
27 | 27 | // Get random address's id from selected route above |
28 | 28 | //-------------------------------------------------------- |
29 | - $addressRand=(array)$route->GetRandomAddressFromRoute($route_id); |
|
30 | - $optimization_problem_id=$addressRand['optimization_problem_id']; |
|
29 | + $addressRand = (array)$route->GetRandomAddressFromRoute($route_id); |
|
30 | + $optimization_problem_id = $addressRand['optimization_problem_id']; |
|
31 | 31 | |
32 | 32 | if (is_null($optimization_problem_id)) { |
33 | 33 | echo "can't retrieve random address!.. Try again."; |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | } |
36 | 36 | //-------------------------------------------------------- |
37 | 37 | |
38 | - $addresses=array(); |
|
38 | + $addresses = array(); |
|
39 | 39 | |
40 | - $address1=(array)Address::fromArray(array( |
|
40 | + $address1 = (array)Address::fromArray(array( |
|
41 | 41 | 'address' => '717 5th Ave New York, NY 10021', |
42 | 42 | 'alias' => 'Giorgio Armani', |
43 | 43 | 'lat' => 40.7669692, |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | 'time' => 0 |
46 | 46 | )); |
47 | 47 | |
48 | - $addresses[0]=$address1; |
|
48 | + $addresses[0] = $address1; |
|
49 | 49 | |
50 | - $OptimizationParameters=(array)OptimizationProblem::fromArray(array( |
|
50 | + $OptimizationParameters = (array)OptimizationProblem::fromArray(array( |
|
51 | 51 | "optimization_problem_id" => $optimization_problem_id, |
52 | 52 | "addresses" => $addresses, |
53 | 53 | "reoptimize" => 1, |
54 | 54 | )); |
55 | 55 | |
56 | - $optimizationproblem=new OptimizationProblem(); |
|
56 | + $optimizationproblem = new OptimizationProblem(); |
|
57 | 57 | |
58 | - $result=$optimizationproblem->update($OptimizationParameters); |
|
58 | + $result = $optimizationproblem->update($OptimizationParameters); |
|
59 | 59 | |
60 | 60 | Route4Me::simplePrint($result); |
61 | 61 | ?> |
62 | 62 | \ No newline at end of file |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | |
16 | 16 | // Get random route from test routes |
17 | 17 | //-------------------------------------------------------- |
18 | - $route=new Route(); |
|
18 | + $route = new Route(); |
|
19 | 19 | |
20 | - $route_id=$route->getRandomRouteId(0, 10); |
|
20 | + $route_id = $route->getRandomRouteId(0, 10); |
|
21 | 21 | |
22 | 22 | if (is_null($route_id)) { |
23 | 23 | echo "can't retrieve random route_id!.. Try again."; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | } |
26 | 26 | //-------------------------------------------------------- |
27 | 27 | |
28 | - $addresses=array(); |
|
28 | + $addresses = array(); |
|
29 | 29 | |
30 | - $params=array( |
|
30 | + $params = array( |
|
31 | 31 | "route_id" => "5C15E83A4BE005BCD1537955D28D51D7", |
32 | 32 | "addresses" => array( |
33 | 33 | "0" => array( |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | "optimal_position" => true |
45 | 45 | ); |
46 | 46 | |
47 | - $route1=new Route(); |
|
47 | + $route1 = new Route(); |
|
48 | 48 | |
49 | - $result=$route1->insertAddressOptimalPosition($params); |
|
49 | + $result = $route1->insertAddressOptimalPosition($params); |
|
50 | 50 | |
51 | 51 | Route4Me::simplePrint((array)$result); |
52 | 52 | ?> |
53 | 53 | \ No newline at end of file |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Route; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | // Set the api key in the Route4Me class |
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | - $address=new Address(); |
|
14 | + $address = new Address(); |
|
15 | 15 | |
16 | 16 | $params = array( |
17 | 17 | "route_id" => "5C15E83A4BE005BCD1537955D28D51D7", |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | "member_id" => 1 |
21 | 21 | ); |
22 | 22 | |
23 | - $result=$address->markAsDeparted($params); |
|
23 | + $result = $address->markAsDeparted($params); |
|
24 | 24 | |
25 | 25 | var_dump($result); |
26 | 26 | ?> |
27 | 27 | \ No newline at end of file |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Address; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | |
14 | 14 | // Get random route from test routes |
15 | 15 | //-------------------------------------------------------- |
16 | - $route=new Route(); |
|
16 | + $route = new Route(); |
|
17 | 17 | |
18 | - $route_id=$route->getRandomRouteId(0, 10); |
|
18 | + $route_id = $route->getRandomRouteId(0, 10); |
|
19 | 19 | |
20 | 20 | if (is_null($route_id)) { |
21 | 21 | echo "can't retrieve random route_id!.. Try again."; |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | // Get random address's id from selected route above |
27 | 27 | //-------------------------------------------------------- |
28 | - $addressRand=(array)$route->GetRandomAddressFromRoute($route_id); |
|
29 | - $route_destination_id=$addressRand['route_destination_id']; |
|
28 | + $addressRand = (array)$route->GetRandomAddressFromRoute($route_id); |
|
29 | + $route_destination_id = $addressRand['route_destination_id']; |
|
30 | 30 | |
31 | 31 | if (is_null($route_destination_id)) { |
32 | 32 | echo "can't retrieve random address!.. Try again."; |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | } |
35 | 35 | //-------------------------------------------------------- |
36 | 36 | |
37 | - $address=new Address(); |
|
37 | + $address = new Address(); |
|
38 | 38 | |
39 | - $addressRetrieved=$address->getAddress($route_id, $route_destination_id); |
|
39 | + $addressRetrieved = $address->getAddress($route_id, $route_destination_id); |
|
40 | 40 | |
41 | 41 | Route4Me::simplePrint((array)$addressRetrieved); |
42 | 42 | ?> |
43 | 43 | \ No newline at end of file |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Route; |
@@ -15,16 +15,16 @@ |
||
15 | 15 | Route4Me::setApiKey('11111111111111111111111111111111'); |
16 | 16 | |
17 | 17 | $params = TrackSetParams::fromArray(array( |
18 | - 'format' => Format::SERIALIZED, |
|
19 | - 'route_id' => '8B4E277A54990986CD80BE36977517E2', |
|
20 | - 'member_id' => 1, |
|
21 | - 'course' => 3, |
|
22 | - 'speed' => 100, |
|
23 | - 'lat' => 41.8927521, |
|
24 | - 'lng' => -109.0803888, |
|
25 | - 'device_type' => DeviceType::IPHONE, |
|
26 | - 'device_guid' => 'qweqweqwe', |
|
27 | - 'device_timestamp' => date('Y-m-d H:i:s') |
|
18 | + 'format' => Format::SERIALIZED, |
|
19 | + 'route_id' => '8B4E277A54990986CD80BE36977517E2', |
|
20 | + 'member_id' => 1, |
|
21 | + 'course' => 3, |
|
22 | + 'speed' => 100, |
|
23 | + 'lat' => 41.8927521, |
|
24 | + 'lng' => -109.0803888, |
|
25 | + 'device_type' => DeviceType::IPHONE, |
|
26 | + 'device_guid' => 'qweqweqwe', |
|
27 | + 'device_timestamp' => date('Y-m-d H:i:s') |
|
28 | 28 | )); |
29 | 29 | |
30 | 30 | $status = Track::set($params); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | //require __DIR__.'/../vendor/autoload.php';; |
@@ -43,9 +43,10 @@ |
||
43 | 43 | |
44 | 44 | $result = $route->GetLastLocation($params); |
45 | 45 | //var_dump($result);die(""); |
46 | - if (isset($result->tracking_history)) |
|
47 | - foreach ($result->tracking_history as $history) { |
|
46 | + if (isset($result->tracking_history)) { |
|
47 | + foreach ($result->tracking_history as $history) { |
|
48 | 48 | echo "Speed --> ".$history['s']."<br>"; |
49 | + } |
|
49 | 50 | echo "course --> ".$history['d']."<br>"; |
50 | 51 | echo "Timestamp --> ".$history['ts_friendly']."<br>"; |
51 | 52 | echo "Latitude --> ".$history['lt']."<br>"; |
@@ -12,16 +12,16 @@ |
||
12 | 12 | use Route4Me\Track; |
13 | 13 | |
14 | 14 | $params = TrackSetParams::fromArray(array( |
15 | - 'format' => Format::CSV, |
|
16 | - 'route_id' => 'AC16E7D338B551013FF34266FE81A5EE', |
|
17 | - 'member_id' => 1, |
|
18 | - 'course' => 1, |
|
19 | - 'speed' => 120, |
|
20 | - 'lat' => 41.8927521, |
|
21 | - 'lng' => -109.0803888, |
|
22 | - 'device_type' => DeviceType::IPHONE, |
|
23 | - 'device_guid' => 'qweqweqwe', |
|
24 | - 'device_timestamp' => date('Y-m-d H:i:s') |
|
15 | + 'format' => Format::CSV, |
|
16 | + 'route_id' => 'AC16E7D338B551013FF34266FE81A5EE', |
|
17 | + 'member_id' => 1, |
|
18 | + 'course' => 1, |
|
19 | + 'speed' => 120, |
|
20 | + 'lat' => 41.8927521, |
|
21 | + 'lng' => -109.0803888, |
|
22 | + 'device_type' => DeviceType::IPHONE, |
|
23 | + 'device_guid' => 'qweqweqwe', |
|
24 | + 'device_timestamp' => date('Y-m-d H:i:s') |
|
25 | 25 | )); |
26 | 26 | |
27 | 27 | $status = Track::set($params); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | +$vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | //require __DIR__.'/../vendor/autoload.php';; |
@@ -68,60 +68,60 @@ discard block |
||
68 | 68 | |
69 | 69 | public static function fromArray(array $params) { |
70 | 70 | $member= new Member(); |
71 | - foreach($params as $key => $value) { |
|
72 | - if (property_exists($member, $key)) { |
|
73 | - $member->{$key} = $value; |
|
74 | - } |
|
71 | + foreach($params as $key => $value) { |
|
72 | + if (property_exists($member, $key)) { |
|
73 | + $member->{$key} = $value; |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $member; |
78 | 78 | } |
79 | 79 | |
80 | 80 | public static function getUsers() |
81 | - { |
|
82 | - $response = Route4Me::makeRequst(array( |
|
83 | - 'url' => self::$apiUrl, |
|
84 | - 'method' => 'GET' |
|
85 | - )); |
|
81 | + { |
|
82 | + $response = Route4Me::makeRequst(array( |
|
83 | + 'url' => self::$apiUrl, |
|
84 | + 'method' => 'GET' |
|
85 | + )); |
|
86 | 86 | //var_dump($response); die(""); |
87 | 87 | return $response; |
88 | 88 | } |
89 | 89 | |
90 | 90 | public static function getUser($params) |
91 | - { |
|
92 | - $response = Route4Me::makeRequst(array( |
|
93 | - 'url' => self::$apiUrl, |
|
94 | - 'method' => 'GET', |
|
95 | - 'query' => array( |
|
96 | - 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
91 | + { |
|
92 | + $response = Route4Me::makeRequst(array( |
|
93 | + 'url' => self::$apiUrl, |
|
94 | + 'method' => 'GET', |
|
95 | + 'query' => array( |
|
96 | + 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
97 | 97 | ) |
98 | - )); |
|
98 | + )); |
|
99 | 99 | //var_dump($response); die(""); |
100 | 100 | return $response; |
101 | 101 | } |
102 | 102 | |
103 | 103 | public static function getUserLocations($param) |
104 | - { |
|
105 | - $response = Route4Me::makeRequst(array( |
|
106 | - 'url' => self::$apiUserLocations, |
|
107 | - 'method' => 'GET', |
|
108 | - 'query' => array( |
|
109 | - 'query' => $param |
|
104 | + { |
|
105 | + $response = Route4Me::makeRequst(array( |
|
106 | + 'url' => self::$apiUserLocations, |
|
107 | + 'method' => 'GET', |
|
108 | + 'query' => array( |
|
109 | + 'query' => $param |
|
110 | 110 | ) |
111 | - )); |
|
111 | + )); |
|
112 | 112 | //var_dump($response); die(""); |
113 | 113 | return $response; |
114 | 114 | } |
115 | 115 | |
116 | 116 | public static function addDeviceRecord($body) |
117 | - { |
|
118 | - $response = Route4Me::makeRequst(array( |
|
119 | - 'url' => self::$apiUrlDevice, |
|
120 | - 'method' => 'POST', |
|
121 | - 'body' => array( |
|
117 | + { |
|
118 | + $response = Route4Me::makeRequst(array( |
|
119 | + 'url' => self::$apiUrlDevice, |
|
120 | + 'method' => 'POST', |
|
121 | + 'body' => array( |
|
122 | 122 | 'device_id' => isset($body->device_id) ? $body->device_id: null, |
123 | - 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
124 | - 'format' => isset($body->format) ? $body->format : null |
|
123 | + 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
124 | + 'format' => isset($body->format) ? $body->format : null |
|
125 | 125 | ) |
126 | 126 | |
127 | 127 | )); |
@@ -129,25 +129,25 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | public static function createMember($body) |
132 | - { |
|
133 | - $response = Route4Me::makeRequst(array( |
|
134 | - 'url' => self::$apiUrl, |
|
135 | - 'method' => 'POST', |
|
136 | - 'body' => array( |
|
132 | + { |
|
133 | + $response = Route4Me::makeRequst(array( |
|
134 | + 'url' => self::$apiUrl, |
|
135 | + 'method' => 'POST', |
|
136 | + 'body' => array( |
|
137 | 137 | 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
138 | - 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
139 | - 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
140 | - 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
141 | - 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
142 | - 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
143 | - 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
144 | - 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
145 | - 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
146 | - 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
147 | - 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
148 | - 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
149 | - 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
150 | - 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
138 | + 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
139 | + 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
140 | + 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
141 | + 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
142 | + 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
143 | + 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
144 | + 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
145 | + 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
146 | + 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
147 | + 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
148 | + 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
149 | + 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
150 | + 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
151 | 151 | ) |
152 | 152 | |
153 | 153 | )); |
@@ -155,26 +155,26 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | public static function updateMember($body) |
158 | - { |
|
159 | - $response = Route4Me::makeRequst(array( |
|
160 | - 'url' => self::$apiUrl, |
|
161 | - 'method' => 'PUT', |
|
162 | - 'body' => array( |
|
158 | + { |
|
159 | + $response = Route4Me::makeRequst(array( |
|
160 | + 'url' => self::$apiUrl, |
|
161 | + 'method' => 'PUT', |
|
162 | + 'body' => array( |
|
163 | 163 | 'member_id' => isset($body->member_id) ? $body->member_id: null, |
164 | - 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
165 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
166 | - 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
167 | - 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
168 | - 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
169 | - 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
170 | - 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
171 | - 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
172 | - 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
173 | - 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
174 | - 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
175 | - 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
176 | - 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
177 | - 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
164 | + 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
165 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
166 | + 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
167 | + 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
168 | + 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
169 | + 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
170 | + 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
171 | + 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
172 | + 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
173 | + 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
174 | + 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
175 | + 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
176 | + 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
177 | + 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
178 | 178 | ) |
179 | 179 | |
180 | 180 | )); |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | public static function deleteMember($body) |
185 | - { |
|
186 | - $response = Route4Me::makeRequst(array( |
|
187 | - 'url' => self::$apiUrl, |
|
188 | - 'method' => 'DELETE', |
|
189 | - 'body' => array( |
|
185 | + { |
|
186 | + $response = Route4Me::makeRequst(array( |
|
187 | + 'url' => self::$apiUrl, |
|
188 | + 'method' => 'DELETE', |
|
189 | + 'body' => array( |
|
190 | 190 | 'member_id' => isset($body->member_id) ? $body->member_id: null |
191 | 191 | ) |
192 | 192 | |
@@ -195,47 +195,47 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | public static function newAccountRegistration($body) |
198 | - { |
|
199 | - $response = Route4Me::makeRequst(array( |
|
200 | - 'url' => self::$apiUrlRegistr, |
|
201 | - 'method' => 'POST', |
|
202 | - 'body' => array( |
|
198 | + { |
|
199 | + $response = Route4Me::makeRequst(array( |
|
200 | + 'url' => self::$apiUrlRegistr, |
|
201 | + 'method' => 'POST', |
|
202 | + 'body' => array( |
|
203 | 203 | 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
204 | - 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
|
205 | - 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
|
206 | - 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | - 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | - 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | - 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | - 'plan' => isset($body->plan) ? $body->plan: null |
|
204 | + 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
|
205 | + 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
|
206 | + 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | + 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | + 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | + 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | + 'plan' => isset($body->plan) ? $body->plan: null |
|
211 | 211 | ) |
212 | 212 | )); |
213 | 213 | return $response; |
214 | 214 | } |
215 | 215 | |
216 | 216 | public static function validateSession($params) |
217 | - { |
|
218 | - $response = Route4Me::makeRequst(array( |
|
219 | - 'url' => self::$apiUrlSessValid, |
|
220 | - 'method' => 'GET', |
|
221 | - 'query' => array( |
|
217 | + { |
|
218 | + $response = Route4Me::makeRequst(array( |
|
219 | + 'url' => self::$apiUrlSessValid, |
|
220 | + 'method' => 'GET', |
|
221 | + 'query' => array( |
|
222 | 222 | 'session_guid' => isset($params->session_guid) ? $params->session_guid: null, |
223 | - 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
224 | - 'format' => isset($params->format) ? $params->format : null |
|
223 | + 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
224 | + 'format' => isset($params->format) ? $params->format : null |
|
225 | 225 | ) |
226 | 226 | )); |
227 | 227 | return $response; |
228 | 228 | } |
229 | 229 | |
230 | 230 | public static function memberAuthentication($body) |
231 | - { |
|
232 | - $response = Route4Me::makeRequst(array( |
|
233 | - 'url' => self::$apiUrlAuthen, |
|
234 | - 'method' => 'POST', |
|
235 | - 'body' => array( |
|
231 | + { |
|
232 | + $response = Route4Me::makeRequst(array( |
|
233 | + 'url' => self::$apiUrlAuthen, |
|
234 | + 'method' => 'POST', |
|
235 | + 'body' => array( |
|
236 | 236 | 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
237 | - 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
|
238 | - 'format' => isset($body->format) ? $body->format : null |
|
237 | + 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
|
238 | + 'format' => isset($body->format) ? $body->format : null |
|
239 | 239 | ) |
240 | 240 | |
241 | 241 | )); |
@@ -243,18 +243,18 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | public static function webinarRegistration($body) |
246 | - { |
|
247 | - $response = Route4Me::makeRequst(array( |
|
248 | - 'url' => self::$apiUrlWebinar, |
|
249 | - 'method' => 'POST', |
|
250 | - 'body' => array( |
|
246 | + { |
|
247 | + $response = Route4Me::makeRequst(array( |
|
248 | + 'url' => self::$apiUrlWebinar, |
|
249 | + 'method' => 'POST', |
|
250 | + 'body' => array( |
|
251 | 251 | 'email_address' => isset($body->email_address) ? $body->email_address: null, |
252 | - 'first_name' => isset($body->first_name) ? $body->first_name : null, |
|
253 | - 'last_name' => isset($body->last_name) ? $body->last_name : null, |
|
254 | - 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
255 | - 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
256 | - 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
257 | - 'webiinar_date' => isset($body->webiinar_date) ? $body->webiinar_date : null, |
|
252 | + 'first_name' => isset($body->first_name) ? $body->first_name : null, |
|
253 | + 'last_name' => isset($body->last_name) ? $body->last_name : null, |
|
254 | + 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
255 | + 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
256 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
257 | + 'webiinar_date' => isset($body->webiinar_date) ? $body->webiinar_date : null, |
|
258 | 258 | ) |
259 | 259 | |
260 | 260 | )); |
@@ -262,19 +262,19 @@ discard block |
||
262 | 262 | } |
263 | 263 | |
264 | 264 | public static function purchaseUserLicense($body) |
265 | - { |
|
266 | - $response = Route4Me::makeRequst(array( |
|
267 | - 'url' => self::$apiUrlLicense, |
|
268 | - 'method' => 'POST', |
|
269 | - 'body' => array( |
|
265 | + { |
|
266 | + $response = Route4Me::makeRequst(array( |
|
267 | + 'url' => self::$apiUrlLicense, |
|
268 | + 'method' => 'POST', |
|
269 | + 'body' => array( |
|
270 | 270 | 'member_id' => isset($body->member_id) ? $body->member_id: null, |
271 | - 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
|
272 | - 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
273 | - 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
274 | - 'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null, |
|
275 | - 'token' => isset($body->token) ? $body->token : null, |
|
276 | - 'payload' => isset($body->payload) ? $body->payload : null, |
|
277 | - 'format' => isset($body->format) ? $body->format : null, |
|
271 | + 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
|
272 | + 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
273 | + 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
274 | + 'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null, |
|
275 | + 'token' => isset($body->token) ? $body->token : null, |
|
276 | + 'payload' => isset($body->payload) ? $body->payload : null, |
|
277 | + 'format' => isset($body->format) ? $body->format : null, |
|
278 | 278 | ) |
279 | 279 | |
280 | 280 | )); |
@@ -282,24 +282,24 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | public static function newMemberConfigKey($body) |
285 | - { |
|
286 | - $response = Route4Me::makeRequst(array( |
|
287 | - 'url' => self::$apiMemberConfig, |
|
288 | - 'method' => 'POST', |
|
289 | - 'body' => array( |
|
285 | + { |
|
286 | + $response = Route4Me::makeRequst(array( |
|
287 | + 'url' => self::$apiMemberConfig, |
|
288 | + 'method' => 'POST', |
|
289 | + 'body' => array( |
|
290 | 290 | 'config_key' => isset($body->config_key) ? $body->config_key: null, |
291 | - 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
291 | + 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
292 | 292 | ) |
293 | 293 | )); |
294 | 294 | return $response; |
295 | 295 | } |
296 | 296 | |
297 | 297 | public static function removeMemberConfigKey($body) |
298 | - { |
|
299 | - $response = Route4Me::makeRequst(array( |
|
300 | - 'url' => self::$apiMemberConfig, |
|
301 | - 'method' => 'DELETE', |
|
302 | - 'body' => array( |
|
298 | + { |
|
299 | + $response = Route4Me::makeRequst(array( |
|
300 | + 'url' => self::$apiMemberConfig, |
|
301 | + 'method' => 'DELETE', |
|
302 | + 'body' => array( |
|
303 | 303 | 'config_key' => isset($body->config_key) ? $body->config_key: null |
304 | 304 | ) |
305 | 305 | )); |
@@ -307,11 +307,11 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | public static function getMemberConfigData($body) |
310 | - { |
|
311 | - $response = Route4Me::makeRequst(array( |
|
312 | - 'url' => self::$apiMemberConfig, |
|
313 | - 'method' => 'GET', |
|
314 | - 'query' => array( |
|
310 | + { |
|
311 | + $response = Route4Me::makeRequst(array( |
|
312 | + 'url' => self::$apiMemberConfig, |
|
313 | + 'method' => 'GET', |
|
314 | + 'query' => array( |
|
315 | 315 | 'config_key' => isset($body->config_key) ? $body->config_key: null |
316 | 316 | ) |
317 | 317 | )); |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | public static function updateMemberConfigKey($body) |
322 | - { |
|
323 | - $response = Route4Me::makeRequst(array( |
|
324 | - 'url' => self::$apiMemberConfig, |
|
325 | - 'method' => 'PUT', |
|
326 | - 'body' => array( |
|
322 | + { |
|
323 | + $response = Route4Me::makeRequst(array( |
|
324 | + 'url' => self::$apiMemberConfig, |
|
325 | + 'method' => 'PUT', |
|
326 | + 'body' => array( |
|
327 | 327 | 'config_key' => isset($body->config_key) ? $body->config_key: null, |
328 | - 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
328 | + 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
329 | 329 | ) |
330 | 330 | )); |
331 | 331 | return $response; |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | public $config_key; |
65 | 65 | public $config_value; |
66 | 66 | |
67 | - public function __construct () { } |
|
67 | + public function __construct() { } |
|
68 | 68 | |
69 | 69 | public static function fromArray(array $params) { |
70 | - $member= new Member(); |
|
71 | - foreach($params as $key => $value) { |
|
70 | + $member = new Member(); |
|
71 | + foreach ($params as $key => $value) { |
|
72 | 72 | if (property_exists($member, $key)) { |
73 | 73 | $member->{$key} = $value; |
74 | 74 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | 'url' => self::$apiUrlDevice, |
120 | 120 | 'method' => 'POST', |
121 | 121 | 'body' => array( |
122 | - 'device_id' => isset($body->device_id) ? $body->device_id: null, |
|
122 | + 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
123 | 123 | 'device_type' => isset($body->device_type) ? $body->device_type : null, |
124 | 124 | 'format' => isset($body->format) ? $body->format : null |
125 | 125 | ) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'url' => self::$apiUrl, |
135 | 135 | 'method' => 'POST', |
136 | 136 | 'body' => array( |
137 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
137 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null, |
|
138 | 138 | 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
139 | 139 | 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
140 | 140 | 'route_count' => isset($body->route_count) ? $body->route_count : null, |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | 'url' => self::$apiUrl, |
161 | 161 | 'method' => 'PUT', |
162 | 162 | 'body' => array( |
163 | - 'member_id' => isset($body->member_id) ? $body->member_id: null, |
|
163 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
164 | 164 | 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
165 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
165 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES : null, |
|
166 | 166 | 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
167 | 167 | 'route_count' => isset($body->route_count) ? $body->route_count : null, |
168 | 168 | 'member_email' => isset($body->member_email) ? $body->member_email : null, |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | 'url' => self::$apiUrl, |
188 | 188 | 'method' => 'DELETE', |
189 | 189 | 'body' => array( |
190 | - 'member_id' => isset($body->member_id) ? $body->member_id: null |
|
190 | + 'member_id' => isset($body->member_id) ? $body->member_id : null |
|
191 | 191 | ) |
192 | 192 | |
193 | 193 | )); |
@@ -200,14 +200,14 @@ discard block |
||
200 | 200 | 'url' => self::$apiUrlRegistr, |
201 | 201 | 'method' => 'POST', |
202 | 202 | 'body' => array( |
203 | - 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
|
203 | + 'strEmail' => isset($body->strEmail) ? $body->strEmail : null, |
|
204 | 204 | 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
205 | 205 | 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
206 | - 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | - 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | - 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | - 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | - 'plan' => isset($body->plan) ? $body->plan: null |
|
206 | + 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName : null, |
|
207 | + 'strLastName' => isset($body->strLastName) ? $body->strLastName : null, |
|
208 | + 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry : null, |
|
209 | + 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms : null, |
|
210 | + 'plan' => isset($body->plan) ? $body->plan : null |
|
211 | 211 | ) |
212 | 212 | )); |
213 | 213 | return $response; |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | 'url' => self::$apiUrlSessValid, |
220 | 220 | 'method' => 'GET', |
221 | 221 | 'query' => array( |
222 | - 'session_guid' => isset($params->session_guid) ? $params->session_guid: null, |
|
222 | + 'session_guid' => isset($params->session_guid) ? $params->session_guid : null, |
|
223 | 223 | 'member_id' => isset($params->member_id) ? $params->member_id : null, |
224 | 224 | 'format' => isset($params->format) ? $params->format : null |
225 | 225 | ) |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | 'url' => self::$apiUrlAuthen, |
234 | 234 | 'method' => 'POST', |
235 | 235 | 'body' => array( |
236 | - 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
|
236 | + 'strEmail' => isset($body->strEmail) ? $body->strEmail : null, |
|
237 | 237 | 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
238 | 238 | 'format' => isset($body->format) ? $body->format : null |
239 | 239 | ) |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | 'url' => self::$apiUrlWebinar, |
249 | 249 | 'method' => 'POST', |
250 | 250 | 'body' => array( |
251 | - 'email_address' => isset($body->email_address) ? $body->email_address: null, |
|
251 | + 'email_address' => isset($body->email_address) ? $body->email_address : null, |
|
252 | 252 | 'first_name' => isset($body->first_name) ? $body->first_name : null, |
253 | 253 | 'last_name' => isset($body->last_name) ? $body->last_name : null, |
254 | 254 | 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | 'url' => self::$apiUrlLicense, |
268 | 268 | 'method' => 'POST', |
269 | 269 | 'body' => array( |
270 | - 'member_id' => isset($body->member_id) ? $body->member_id: null, |
|
270 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
271 | 271 | 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
272 | 272 | 'device_id' => isset($body->device_id) ? $body->device_id : null, |
273 | 273 | 'device_type' => isset($body->device_type) ? $body->device_type : null, |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | 'url' => self::$apiMemberConfig, |
288 | 288 | 'method' => 'POST', |
289 | 289 | 'body' => array( |
290 | - 'config_key' => isset($body->config_key) ? $body->config_key: null, |
|
290 | + 'config_key' => isset($body->config_key) ? $body->config_key : null, |
|
291 | 291 | 'config_value' => isset($body->config_value) ? $body->config_value : null |
292 | 292 | ) |
293 | 293 | )); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | 'url' => self::$apiMemberConfig, |
301 | 301 | 'method' => 'DELETE', |
302 | 302 | 'body' => array( |
303 | - 'config_key' => isset($body->config_key) ? $body->config_key: null |
|
303 | + 'config_key' => isset($body->config_key) ? $body->config_key : null |
|
304 | 304 | ) |
305 | 305 | )); |
306 | 306 | return $response; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | 'url' => self::$apiMemberConfig, |
313 | 313 | 'method' => 'GET', |
314 | 314 | 'query' => array( |
315 | - 'config_key' => isset($body->config_key) ? $body->config_key: null |
|
315 | + 'config_key' => isset($body->config_key) ? $body->config_key : null |
|
316 | 316 | ) |
317 | 317 | )); |
318 | 318 | return $response; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | 'url' => self::$apiMemberConfig, |
325 | 325 | 'method' => 'PUT', |
326 | 326 | 'body' => array( |
327 | - 'config_key' => isset($body->config_key) ? $body->config_key: null, |
|
327 | + 'config_key' => isset($body->config_key) ? $body->config_key : null, |
|
328 | 328 | 'config_value' => isset($body->config_value) ? $body->config_value : null |
329 | 329 | ) |
330 | 330 | )); |
@@ -7,20 +7,20 @@ |
||
7 | 7 | |
8 | 8 | class Track extends Common |
9 | 9 | { |
10 | - public static $apiUrl = '/track/set.php'; |
|
10 | + public static $apiUrl = '/track/set.php'; |
|
11 | 11 | |
12 | - public static function set(TrackSetParams $param) |
|
13 | - { |
|
14 | - $query = array_merge($param->toArray(), array( |
|
15 | - 'api_key' => Route4Me::getApiKey() |
|
16 | - )); |
|
12 | + public static function set(TrackSetParams $param) |
|
13 | + { |
|
14 | + $query = array_merge($param->toArray(), array( |
|
15 | + 'api_key' => Route4Me::getApiKey() |
|
16 | + )); |
|
17 | 17 | |
18 | - $json = Route4Me::makeRequst(array( |
|
19 | - 'url' => self::$apiUrl, |
|
20 | - 'method' => 'GET', |
|
21 | - 'query' => $query |
|
22 | - )); |
|
18 | + $json = Route4Me::makeRequst(array( |
|
19 | + 'url' => self::$apiUrl, |
|
20 | + 'method' => 'GET', |
|
21 | + 'query' => $query |
|
22 | + )); |
|
23 | 23 | |
24 | - return $json['status']; |
|
25 | - } |
|
24 | + return $json['status']; |
|
25 | + } |
|
26 | 26 | } |
@@ -32,127 +32,127 @@ |
||
32 | 32 | |
33 | 33 | public static function fromArray(array $params) { |
34 | 34 | $addressbooklocation = new AddressBookLocation(); |
35 | - foreach($params as $key => $value) { |
|
36 | - if (property_exists($addressbooklocation, $key)) { |
|
37 | - $addressbooklocation->{$key} = $value; |
|
38 | - } |
|
35 | + foreach($params as $key => $value) { |
|
36 | + if (property_exists($addressbooklocation, $key)) { |
|
37 | + $addressbooklocation->{$key} = $value; |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | return $addressbooklocation; |
42 | 42 | } |
43 | 43 | |
44 | 44 | public static function getAddressBookLocation($addressId) |
45 | - { |
|
46 | - $ablocations = Route4Me::makeRequst(array( |
|
47 | - 'url' => self::$apiUrl, |
|
48 | - 'method' => 'GET', |
|
49 | - 'query' => array( |
|
50 | - 'query' => $addressId, |
|
51 | - 'limit' => 30 |
|
52 | - ) |
|
53 | - )); |
|
45 | + { |
|
46 | + $ablocations = Route4Me::makeRequst(array( |
|
47 | + 'url' => self::$apiUrl, |
|
48 | + 'method' => 'GET', |
|
49 | + 'query' => array( |
|
50 | + 'query' => $addressId, |
|
51 | + 'limit' => 30 |
|
52 | + ) |
|
53 | + )); |
|
54 | 54 | |
55 | 55 | return $ablocations; |
56 | 56 | } |
57 | 57 | |
58 | 58 | public static function searchRoutedLocation($params) |
59 | - { |
|
60 | - $result= Route4Me::makeRequst(array( |
|
61 | - 'url' => self::$apiUrl, |
|
62 | - 'method' => 'GET', |
|
63 | - 'query' => array( |
|
64 | - 'display' => isset($params['display']) ? $params['display']: null, |
|
65 | - 'query' => isset($params['query']) ? $params['query']: null, |
|
66 | - 'fields' => isset($params['fields']) ? $params['fields']: null, |
|
67 | - 'limit' => isset($params['limit']) ? $params['limit']: null, |
|
68 | - 'offset' => isset($params['offset']) ? $params['offset'] : null, |
|
69 | - ) |
|
70 | - )); |
|
59 | + { |
|
60 | + $result= Route4Me::makeRequst(array( |
|
61 | + 'url' => self::$apiUrl, |
|
62 | + 'method' => 'GET', |
|
63 | + 'query' => array( |
|
64 | + 'display' => isset($params['display']) ? $params['display']: null, |
|
65 | + 'query' => isset($params['query']) ? $params['query']: null, |
|
66 | + 'fields' => isset($params['fields']) ? $params['fields']: null, |
|
67 | + 'limit' => isset($params['limit']) ? $params['limit']: null, |
|
68 | + 'offset' => isset($params['offset']) ? $params['offset'] : null, |
|
69 | + ) |
|
70 | + )); |
|
71 | 71 | |
72 | 72 | return $result; |
73 | 73 | } |
74 | 74 | |
75 | 75 | public static function getAddressBookLocations($params) |
76 | - { |
|
77 | - $ablocations = Route4Me::makeRequst(array( |
|
78 | - 'url' => self::$apiUrl, |
|
79 | - 'method' => 'GET', |
|
80 | - 'query' => array( |
|
81 | - 'limit' => isset($params->limit) ? $params->limit: null, |
|
82 | - 'offset' => isset($params->offset) ? $params->offset : null, |
|
83 | - ) |
|
84 | - )); |
|
76 | + { |
|
77 | + $ablocations = Route4Me::makeRequst(array( |
|
78 | + 'url' => self::$apiUrl, |
|
79 | + 'method' => 'GET', |
|
80 | + 'query' => array( |
|
81 | + 'limit' => isset($params->limit) ? $params->limit: null, |
|
82 | + 'offset' => isset($params->offset) ? $params->offset : null, |
|
83 | + ) |
|
84 | + )); |
|
85 | 85 | |
86 | 86 | return $ablocations; |
87 | 87 | } |
88 | 88 | |
89 | 89 | public static function getAddressBookLocationsByIds($ids) |
90 | - { |
|
91 | - $ablocations = Route4Me::makeRequst(array( |
|
92 | - 'url' => self::$apiUrl, |
|
93 | - 'method' => 'GET', |
|
94 | - 'query' => array( |
|
95 | - 'address_id' => $ids |
|
96 | - ) |
|
97 | - )); |
|
90 | + { |
|
91 | + $ablocations = Route4Me::makeRequst(array( |
|
92 | + 'url' => self::$apiUrl, |
|
93 | + 'method' => 'GET', |
|
94 | + 'query' => array( |
|
95 | + 'address_id' => $ids |
|
96 | + ) |
|
97 | + )); |
|
98 | 98 | |
99 | 99 | return $ablocations; |
100 | 100 | } |
101 | 101 | |
102 | 102 | public static function addAdressBookLocation($params) |
103 | - { |
|
104 | - $ablocations = Route4Me::makeRequst(array( |
|
105 | - 'url' => self::$apiUrl, |
|
106 | - 'method' => 'ADD', |
|
107 | - 'query' => array( |
|
108 | - 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
109 | - 'first_name' => isset($params->first_name) ? $params->first_name : null, |
|
110 | - 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
|
111 | - 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
|
112 | - ) |
|
113 | - )); |
|
103 | + { |
|
104 | + $ablocations = Route4Me::makeRequst(array( |
|
105 | + 'url' => self::$apiUrl, |
|
106 | + 'method' => 'ADD', |
|
107 | + 'query' => array( |
|
108 | + 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
109 | + 'first_name' => isset($params->first_name) ? $params->first_name : null, |
|
110 | + 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
|
111 | + 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
|
112 | + ) |
|
113 | + )); |
|
114 | 114 | |
115 | 115 | return $ablocations; |
116 | 116 | } |
117 | 117 | |
118 | 118 | public function deleteAdressBookLocation($address_ids) |
119 | - { |
|
120 | - $address = Route4Me::makeRequst(array( |
|
121 | - 'url' => self::$apiUrl, |
|
122 | - 'method' => 'DELETEARRAY', |
|
123 | - 'query' => array( |
|
124 | - 'address_ids' => $address_ids |
|
125 | - ) |
|
126 | - )); |
|
119 | + { |
|
120 | + $address = Route4Me::makeRequst(array( |
|
121 | + 'url' => self::$apiUrl, |
|
122 | + 'method' => 'DELETEARRAY', |
|
123 | + 'query' => array( |
|
124 | + 'address_ids' => $address_ids |
|
125 | + ) |
|
126 | + )); |
|
127 | 127 | |
128 | - return $address; |
|
129 | - } |
|
128 | + return $address; |
|
129 | + } |
|
130 | 130 | |
131 | 131 | public function updateAdressBookLocation($params) |
132 | - { |
|
133 | - //echo "address_id --> ".$params["address_id"]."<br"; |
|
134 | - $address = Route4Me::makeRequst(array( |
|
135 | - 'url' => self::$apiUrl, |
|
136 | - 'method' => 'PUT', |
|
137 | - 'query' => $params, |
|
132 | + { |
|
133 | + //echo "address_id --> ".$params["address_id"]."<br"; |
|
134 | + $address = Route4Me::makeRequst(array( |
|
135 | + 'url' => self::$apiUrl, |
|
136 | + 'method' => 'PUT', |
|
137 | + 'query' => $params, |
|
138 | 138 | |
139 | - )); |
|
139 | + )); |
|
140 | 140 | |
141 | - return $address; |
|
142 | - } |
|
141 | + return $address; |
|
142 | + } |
|
143 | 143 | |
144 | 144 | public static function get($params) |
145 | - { |
|
146 | - $ablocations = Route4Me::makeRequst(array( |
|
147 | - 'url' => self::$apiUrl, |
|
148 | - 'method' => 'ADD', |
|
149 | - 'query' => array( |
|
150 | - 'first_name' => isset($params->first_name) ? $params->first_name : null, |
|
151 | - 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
152 | - 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
|
153 | - 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
|
154 | - ) |
|
155 | - )); |
|
145 | + { |
|
146 | + $ablocations = Route4Me::makeRequst(array( |
|
147 | + 'url' => self::$apiUrl, |
|
148 | + 'method' => 'ADD', |
|
149 | + 'query' => array( |
|
150 | + 'first_name' => isset($params->first_name) ? $params->first_name : null, |
|
151 | + 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
152 | + 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
|
153 | + 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
|
154 | + ) |
|
155 | + )); |
|
156 | 156 | |
157 | 157 | return $ablocations; |
158 | 158 | } |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | //public $offset; |
29 | 29 | //public $limit; |
30 | 30 | |
31 | - public function __construct () { } |
|
31 | + public function __construct() { } |
|
32 | 32 | |
33 | 33 | public static function fromArray(array $params) { |
34 | 34 | $addressbooklocation = new AddressBookLocation(); |
35 | - foreach($params as $key => $value) { |
|
35 | + foreach ($params as $key => $value) { |
|
36 | 36 | if (property_exists($addressbooklocation, $key)) { |
37 | 37 | $addressbooklocation->{$key} = $value; |
38 | 38 | } |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | |
58 | 58 | public static function searchRoutedLocation($params) |
59 | 59 | { |
60 | - $result= Route4Me::makeRequst(array( |
|
60 | + $result = Route4Me::makeRequst(array( |
|
61 | 61 | 'url' => self::$apiUrl, |
62 | 62 | 'method' => 'GET', |
63 | 63 | 'query' => array( |
64 | - 'display' => isset($params['display']) ? $params['display']: null, |
|
65 | - 'query' => isset($params['query']) ? $params['query']: null, |
|
66 | - 'fields' => isset($params['fields']) ? $params['fields']: null, |
|
67 | - 'limit' => isset($params['limit']) ? $params['limit']: null, |
|
64 | + 'display' => isset($params['display']) ? $params['display'] : null, |
|
65 | + 'query' => isset($params['query']) ? $params['query'] : null, |
|
66 | + 'fields' => isset($params['fields']) ? $params['fields'] : null, |
|
67 | + 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
68 | 68 | 'offset' => isset($params['offset']) ? $params['offset'] : null, |
69 | 69 | ) |
70 | 70 | )); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | 'url' => self::$apiUrl, |
79 | 79 | 'method' => 'GET', |
80 | 80 | 'query' => array( |
81 | - 'limit' => isset($params->limit) ? $params->limit: null, |
|
81 | + 'limit' => isset($params->limit) ? $params->limit : null, |
|
82 | 82 | 'offset' => isset($params->offset) ? $params->offset : null, |
83 | 83 | ) |
84 | 84 | )); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'url' => self::$apiUrl, |
106 | 106 | 'method' => 'ADD', |
107 | 107 | 'query' => array( |
108 | - 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
108 | + 'address_1' => isset($params->address_1) ? $params->address_1 : null, |
|
109 | 109 | 'first_name' => isset($params->first_name) ? $params->first_name : null, |
110 | 110 | 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
111 | 111 | 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | 'method' => 'ADD', |
149 | 149 | 'query' => array( |
150 | 150 | 'first_name' => isset($params->first_name) ? $params->first_name : null, |
151 | - 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
151 | + 'address_1' => isset($params->address_1) ? $params->address_1 : null, |
|
152 | 152 | 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
153 | 153 | 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
154 | 154 | ) |