Completed
Pull Request — master (#108)
by Jason
03:10
created
code/DistanceDataExtension.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,21 +2,21 @@
 block discarded – undo
2 2
 
3 3
 class DistanceDataExtension extends DataExtension
4 4
 {
5
-    /**
6
-     * @param SQLQuery $query
7
-     */
8
-    public function augmentSQL(SQLQuery &$query)
9
-    {
10
-        if (Controller::curr()->getRequest()->getVar('Address')) { // on frontend
11
-            $coords = GoogleGeocoding::address_to_point(Controller::curr()->getRequest()->getVar('Address'));
5
+	/**
6
+	 * @param SQLQuery $query
7
+	 */
8
+	public function augmentSQL(SQLQuery &$query)
9
+	{
10
+		if (Controller::curr()->getRequest()->getVar('Address')) { // on frontend
11
+			$coords = GoogleGeocoding::address_to_point(Controller::curr()->getRequest()->getVar('Address'));
12 12
 
13
-            $Lat = $coords['lat'];
14
-            $Lng = $coords['lng'];
13
+			$Lat = $coords['lat'];
14
+			$Lng = $coords['lng'];
15 15
 
16
-            $query
17
-                ->addSelect(array(
18
-                    '( 3959 * acos( cos( radians('.$Lat.') ) * cos( radians( `Lat` ) ) * cos( radians( `Lng` ) - radians('.$Lng.') ) + sin( radians('.$Lat.') ) * sin( radians( `Lat` ) ) ) ) AS distance',
19
-                ));
20
-        }
21
-    }
16
+			$query
17
+				->addSelect(array(
18
+					'( 3959 * acos( cos( radians('.$Lat.') ) * cos( radians( `Lat` ) ) * cos( radians( `Lng` ) - radians('.$Lng.') ) + sin( radians('.$Lat.') ) * sin( radians( `Lat` ) ) ) ) AS distance',
19
+				));
20
+		}
21
+	}
22 22
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
     /**
6 6
      * @param SQLQuery $query
7 7
      */
8
-    public function augmentSQL(SQLQuery &$query)
8
+    public function augmentSQL(SQLQuery & $query)
9 9
     {
10 10
         if (Controller::curr()->getRequest()->getVar('Address')) { // on frontend
11 11
             $coords = GoogleGeocoding::address_to_point(Controller::curr()->getRequest()->getVar('Address'));
Please login to merge, or discard this patch.