@@ -22,7 +22,7 @@ |
||
22 | 22 | $json = array_slice($json, 0, 10); |
23 | 23 | |
24 | 24 | $addresses = array(); |
25 | -foreach($json as $address) { |
|
25 | +foreach ($json as $address) { |
|
26 | 26 | $addresses[] = Address::fromArray($address); |
27 | 27 | } |
28 | 28 |
@@ -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 | |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | // Set the api key in the Route4Me class |
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | - $abLocation=new AddressBookLocation(); |
|
13 | + $abLocation = new AddressBookLocation(); |
|
14 | 14 | |
15 | 15 | //Example for retrieving Address Book Location by address_id |
16 | 16 | //--------------------------------------------------------- |
17 | - $query=4621569; |
|
18 | - $abcResult=$abLocation->getAddressBookLocation($query); |
|
17 | + $query = 4621569; |
|
18 | + $abcResult = $abLocation->getAddressBookLocation($query); |
|
19 | 19 | |
20 | - $results=$abLocation->getValue($abcResult,"results"); |
|
20 | + $results = $abLocation->getValue($abcResult, "results"); |
|
21 | 21 | |
22 | 22 | Route4Me::simplePrint($results); |
23 | 23 | //--------------------------------------------------------- |
@@ -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,21 +11,21 @@ discard block |
||
11 | 11 | // Set the api key in the Route4Me class |
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | - $AdressBookLocationParameters=AddressBookLocation::fromArray(array( |
|
15 | - "first_name" => "Test FirstName ".strval(rand(10000,99999)), |
|
16 | - "address_1" => "Test Address1 ".strval(rand(10000,99999)), |
|
14 | + $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
|
15 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
16 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
17 | 17 | "cached_lat" => 38.024654, |
18 | 18 | "cached_lng" => -77.338814 |
19 | 19 | )); |
20 | 20 | |
21 | - $abContacts=new AddressBookLocation(); |
|
21 | + $abContacts = new AddressBookLocation(); |
|
22 | 22 | |
23 | - $abcResults=$abContacts->addAdressBookLocation($AdressBookLocationParameters); |
|
23 | + $abcResults = $abContacts->addAdressBookLocation($AdressBookLocationParameters); |
|
24 | 24 | |
25 | - $address_id=-1; |
|
25 | + $address_id = -1; |
|
26 | 26 | if (is_array($abcResults)) { |
27 | 27 | if (isset($abcResults["address_id"])) { |
28 | - $address_id=$abcResults["address_id"]; |
|
28 | + $address_id = $abcResults["address_id"]; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | } |
36 | 36 | echo "Address Book Location with address_id = ".strval($address_id)." was successfully added<br>"; |
37 | 37 | |
38 | - $addressBookLocations=array(6305950); |
|
38 | + $addressBookLocations = array(6305950); |
|
39 | 39 | |
40 | - $abLocations=new AddressBookLocation(); |
|
40 | + $abLocations = new AddressBookLocation(); |
|
41 | 41 | |
42 | - $deleteResult=$abLocations->deleteAdressBookLocation($addressBookLocations); |
|
42 | + $deleteResult = $abLocations->deleteAdressBookLocation($addressBookLocations); |
|
43 | 43 | |
44 | - if (is_array($deleteResult)){ |
|
44 | + if (is_array($deleteResult)) { |
|
45 | 45 | if (sizeof($deleteResult)>0) { |
46 | 46 | echo "Address Book Location with address_id = ".strval($address_id)." was successfully deleted<br>"; |
47 | 47 | } else { |
@@ -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,16 +11,16 @@ discard block |
||
11 | 11 | // Set the api key in the Route4me class |
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | - $AdressBookLocationParameters=AddressBookLocation::fromArray(array( |
|
15 | - "first_name" => "Test FirstName ".strval(rand(10000,99999)), |
|
16 | - "address_1" => "Test Address1 ".strval(rand(10000,99999)), |
|
14 | + $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
|
15 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
16 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
17 | 17 | "cached_lat" => 38.024654, |
18 | 18 | "cached_lng" => -77.338814 |
19 | 19 | )); |
20 | 20 | |
21 | - $abContacts=new AddressBookLocation(); |
|
21 | + $abContacts = new AddressBookLocation(); |
|
22 | 22 | |
23 | - $abcResults=$abContacts->addAdressBookLocation($AdressBookLocationParameters); |
|
23 | + $abcResults = $abContacts->addAdressBookLocation($AdressBookLocationParameters); |
|
24 | 24 | |
25 | 25 | echo "address_id = ".strval($abcResults["address_id"])."<br>"; |
26 | 26 |
@@ -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,16 +11,16 @@ discard block |
||
11 | 11 | // Set the api key in the Route4Me class |
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | - $AdressBookLocationParameters=AddressBookLocation::fromArray(array( |
|
14 | + $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
|
15 | 15 | "limit" => 30, |
16 | 16 | "offset" => 0 |
17 | 17 | )); |
18 | 18 | |
19 | - $abContacts=new AddressBookLocation(); |
|
19 | + $abContacts = new AddressBookLocation(); |
|
20 | 20 | |
21 | - $abcResults=$abContacts->getAddressBookLocations($AdressBookLocationParameters); |
|
21 | + $abcResults = $abContacts->getAddressBookLocations($AdressBookLocationParameters); |
|
22 | 22 | |
23 | - $results=$abContacts->getValue($abcResults,"results"); |
|
23 | + $results = $abContacts->getValue($abcResults, "results"); |
|
24 | 24 | |
25 | 25 | Route4Me::simplePrint($results); |
26 | 26 |
@@ -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 | require $vdir.'/../vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -9,17 +9,17 @@ discard block |
||
9 | 9 | // Set the api key in the Route4Me class |
10 | 10 | Route4Me::setApiKey('11111111111111111111111111111111'); |
11 | 11 | |
12 | - $ablocation=new AddressBookLocation(); |
|
12 | + $ablocation = new AddressBookLocation(); |
|
13 | 13 | |
14 | 14 | //Example refers to the process of search for routed addresses |
15 | 15 | //--------------------------------------------------------- |
16 | - $params= array( |
|
16 | + $params = array( |
|
17 | 17 | 'display'=> 'routed' |
18 | 18 | ); |
19 | 19 | |
20 | - $abcResult=$ablocation->getAddressBookLocation($params); |
|
20 | + $abcResult = $ablocation->getAddressBookLocation($params); |
|
21 | 21 | |
22 | - $results=$ablocation->getValue($abcResult,"results"); |
|
22 | + $results = $ablocation->getValue($abcResult, "results"); |
|
23 | 23 | |
24 | 24 | Route4Me::simplePrint($results); |
25 | 25 | //--------------------------------------------------------- |
@@ -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 | |
@@ -10,21 +10,21 @@ discard block |
||
10 | 10 | // Set the api key in the Route4Me class |
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | - $AdressBookLocationParameters=AddressBookLocation::fromArray(array( |
|
14 | - "first_name" => "Test FirstName ".strval(rand(10000,99999)), |
|
15 | - "address_1" => "Test Address1 ".strval(rand(10000,99999)), |
|
13 | + $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
|
14 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
15 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
16 | 16 | "cached_lat" => 38.024654, |
17 | 17 | "cached_lng" => -77.338814 |
18 | 18 | )); |
19 | 19 | |
20 | - $abLocations=new AddressBookLocation(); |
|
20 | + $abLocations = new AddressBookLocation(); |
|
21 | 21 | |
22 | - $abcResults=$abLocations->addAdressBookLocation($AdressBookLocationParameters); |
|
22 | + $abcResults = $abLocations->addAdressBookLocation($AdressBookLocationParameters); |
|
23 | 23 | |
24 | - $address_id=-1; |
|
24 | + $address_id = -1; |
|
25 | 25 | if (is_array($abcResults)) { |
26 | 26 | if (isset($abcResults["address_id"])) { |
27 | - $address_id=$abcResults["address_id"]; |
|
27 | + $address_id = $abcResults["address_id"]; |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | return; |
34 | 34 | } |
35 | 35 | echo "Address Book Location with address_id = ".strval($address_id)." was successfully added<br>"; |
36 | - $abcResults["first_name"]="Test Firstname Updated"; |
|
36 | + $abcResults["first_name"] = "Test Firstname Updated"; |
|
37 | 37 | //$abcResults["address_1"]="Test address Updated"; |
38 | - $abcResults=$abLocations->updateAdressBookLocation($abcResults); |
|
38 | + $abcResults = $abLocations->updateAdressBookLocation($abcResults); |
|
39 | 39 | |
40 | 40 | Route4Me::simplePrint($abcResults); |
41 | 41 |
@@ -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 | require $vdir.'/../vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | // Set the api key in the Route4Me class |
10 | 10 | Route4Me::setApiKey('11111111111111111111111111111111'); |
11 | 11 | |
12 | - $ablocation=new AddressBookLocation(); |
|
12 | + $ablocation = new AddressBookLocation(); |
|
13 | 13 | |
14 | 14 | //Example refers to the process of retrieving sepcified fields by containg specified text in any field |
15 | 15 | //--------------------------------------------------------- |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | "limit" => 20, |
22 | 22 | ); |
23 | 23 | |
24 | - $abcResult=$ablocation->searchRoutedLocation($params); |
|
24 | + $abcResult = $ablocation->searchRoutedLocation($params); |
|
25 | 25 | |
26 | - $results=$ablocation->getValue($abcResult,"results"); |
|
26 | + $results = $ablocation->getValue($abcResult, "results"); |
|
27 | 27 | |
28 | 28 | Route4Me::simplePrint($results); |
29 | 29 | //--------------------------------------------------------- |
@@ -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 | require $vdir.'/../vendor/autoload.php'; |
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | // Set the api key in the Route4Me class |
10 | 10 | Route4Me::setApiKey('11111111111111111111111111111111'); |
11 | 11 | |
12 | - $ablocation=new AddressBookLocation(); |
|
12 | + $ablocation = new AddressBookLocation(); |
|
13 | 13 | |
14 | 14 | //Example for retrieving Address Book Locations by address_ids |
15 | 15 | //--------------------------------------------------------- |
16 | - $ids="4623361,6281217"; |
|
16 | + $ids = "4623361,6281217"; |
|
17 | 17 | //$ablocation->address_id = $ids; |
18 | - $abcResult=$ablocation->getAddressBookLocationsByIds($ids); |
|
18 | + $abcResult = $ablocation->getAddressBookLocationsByIds($ids); |
|
19 | 19 | |
20 | - $results=$ablocation->getValue($abcResult,"results"); |
|
20 | + $results = $ablocation->getValue($abcResult, "results"); |
|
21 | 21 | |
22 | 22 | Route4Me::simplePrint($results); |
23 | 23 | //--------------------------------------------------------- |