@@ -12,45 +12,45 @@ |
||
12 | 12 | */ |
13 | 13 | class Map_Model extends Model_Base { |
14 | 14 | |
15 | - /** |
|
16 | - * @var WPMap |
|
17 | - */ |
|
18 | - protected $_map; |
|
15 | + /** |
|
16 | + * @var WPMap |
|
17 | + */ |
|
18 | + protected $_map; |
|
19 | 19 | |
20 | - /** |
|
21 | - * @return bool |
|
22 | - */ |
|
23 | - function has_map() { |
|
20 | + /** |
|
21 | + * @return bool |
|
22 | + */ |
|
23 | + function has_map() { |
|
24 | 24 | |
25 | - return $this->_has('_map' ); |
|
25 | + return $this->_has('_map' ); |
|
26 | 26 | |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * @param string $method_name |
|
31 | - * @param array $args |
|
32 | - * |
|
33 | - * @return mixed |
|
34 | - */ |
|
35 | - function __call( $method_name, $args = array() ) { |
|
36 | - $value = null; |
|
29 | + /** |
|
30 | + * @param string $method_name |
|
31 | + * @param array $args |
|
32 | + * |
|
33 | + * @return mixed |
|
34 | + */ |
|
35 | + function __call( $method_name, $args = array() ) { |
|
36 | + $value = null; |
|
37 | 37 | |
38 | - do { |
|
38 | + do { |
|
39 | 39 | |
40 | - if ( property_exists( $this, "_{$method_name}" ) ) { |
|
41 | - $property = "_{$method_name}"; |
|
42 | - $value = $this->{$property}; |
|
43 | - break; |
|
44 | - } |
|
40 | + if ( property_exists( $this, "_{$method_name}" ) ) { |
|
41 | + $property = "_{$method_name}"; |
|
42 | + $value = $this->{$property}; |
|
43 | + break; |
|
44 | + } |
|
45 | 45 | |
46 | - if ( ! isset( $this->_map ) ) { |
|
47 | - break; |
|
48 | - } |
|
46 | + if ( ! isset( $this->_map ) ) { |
|
47 | + break; |
|
48 | + } |
|
49 | 49 | |
50 | - $value = call_user_func_array( array( $this->_map, $method_name ), $args ); |
|
50 | + $value = call_user_func_array( array( $this->_map, $method_name ), $args ); |
|
51 | 51 | |
52 | - } while ( false ); |
|
52 | + } while ( false ); |
|
53 | 53 | |
54 | - return $value; |
|
55 | - } |
|
54 | + return $value; |
|
55 | + } |
|
56 | 56 | } |
@@ -24,31 +24,31 @@ discard block |
||
24 | 24 | */ |
25 | 25 | protected $_location; |
26 | 26 | |
27 | - /** |
|
28 | - * Location_Model constructor. |
|
29 | - * |
|
30 | - * @param array $args |
|
31 | - */ |
|
32 | - function __construct( $args = array() ) { |
|
27 | + /** |
|
28 | + * Location_Model constructor. |
|
29 | + * |
|
30 | + * @param array $args |
|
31 | + */ |
|
32 | + function __construct( $args = array() ) { |
|
33 | 33 | |
34 | - $location = new WPLoc( $args ); |
|
34 | + $location = new WPLoc( $args ); |
|
35 | 35 | |
36 | - $args = wp_parse_args( $args, array( |
|
37 | - 'location' => $location, |
|
38 | - ) ); |
|
36 | + $args = wp_parse_args( $args, array( |
|
37 | + 'location' => $location, |
|
38 | + ) ); |
|
39 | 39 | |
40 | - parent::__construct( $args ); |
|
40 | + parent::__construct( $args ); |
|
41 | 41 | |
42 | - } |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return bool |
|
46 | - */ |
|
47 | - function has_location() { |
|
44 | + /** |
|
45 | + * @return bool |
|
46 | + */ |
|
47 | + function has_location() { |
|
48 | 48 | |
49 | - return $this->_has( '_location' ); |
|
49 | + return $this->_has( '_location' ); |
|
50 | 50 | |
51 | - } |
|
51 | + } |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * @param string $method_name |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | public function __call( $method_name, $args ) { |
58 | 58 | $value = null; |
59 | 59 | |
60 | - do { |
|
60 | + do { |
|
61 | 61 | |
62 | - if ( property_exists( $this, "_{$method_name}" ) ) { |
|
63 | - $property = "_{$method_name}"; |
|
64 | - $value = $this->{$property}; |
|
65 | - break; |
|
66 | - } |
|
62 | + if ( property_exists( $this, "_{$method_name}" ) ) { |
|
63 | + $property = "_{$method_name}"; |
|
64 | + $value = $this->{$property}; |
|
65 | + break; |
|
66 | + } |
|
67 | 67 | |
68 | - if ( ! isset( $this->_location ) ) { |
|
69 | - break; |
|
70 | - } |
|
68 | + if ( ! isset( $this->_location ) ) { |
|
69 | + break; |
|
70 | + } |
|
71 | 71 | |
72 | - $value = call_user_func_array( array( $this->_location, $method_name ), $args ); |
|
72 | + $value = call_user_func_array( array( $this->_location, $method_name ), $args ); |
|
73 | 73 | |
74 | - } while ( false ); |
|
74 | + } while ( false ); |
|
75 | 75 | |
76 | 76 | return $value; |
77 | 77 | } |
@@ -14,20 +14,20 @@ discard block |
||
14 | 14 | |
15 | 15 | const INSTANCE_CLASS = 'Clubdeuce\WPLib\Components\GoogleMaps\Map'; |
16 | 16 | |
17 | - /** |
|
18 | - * @var string |
|
19 | - */ |
|
20 | - protected static $_version = '0.1.6'; |
|
21 | - |
|
22 | - /** |
|
23 | - * |
|
24 | - */ |
|
17 | + /** |
|
18 | + * @var string |
|
19 | + */ |
|
20 | + protected static $_version = '0.1.6'; |
|
21 | + |
|
22 | + /** |
|
23 | + * |
|
24 | + */ |
|
25 | 25 | static function on_load() { |
26 | 26 | |
27 | - require_once 'vendor/autoload.php'; |
|
28 | - require_once 'includes/class-model-base.php'; |
|
27 | + require_once 'vendor/autoload.php'; |
|
28 | + require_once 'includes/class-model-base.php'; |
|
29 | 29 | self::register_helper( '\Clubdeuce\WPGoogleMaps\Google_Maps', __CLASS__ ); |
30 | - \Clubdeuce\WPGoogleMaps\Google_Maps::initialize(); |
|
30 | + \Clubdeuce\WPGoogleMaps\Google_Maps::initialize(); |
|
31 | 31 | |
32 | 32 | } |
33 | 33 | |
@@ -42,32 +42,32 @@ discard block |
||
42 | 42 | |
43 | 43 | } |
44 | 44 | |
45 | - /** |
|
46 | - * @param $address |
|
47 | - * @param array $args |
|
48 | - * |
|
49 | - * @return Marker |
|
50 | - */ |
|
45 | + /** |
|
46 | + * @param $address |
|
47 | + * @param array $args |
|
48 | + * |
|
49 | + * @return Marker |
|
50 | + */ |
|
51 | 51 | static function make_marker_by_address( $address, $args = array() ) { |
52 | 52 | |
53 | - $marker = \Clubdeuce\WPGoogleMaps\Google_Maps::make_marker_by_address( $address, $args ); |
|
54 | - return new Marker( array_merge( array( 'marker' => $marker ), $args ) ); |
|
53 | + $marker = \Clubdeuce\WPGoogleMaps\Google_Maps::make_marker_by_address( $address, $args ); |
|
54 | + return new Marker( array_merge( array( 'marker' => $marker ), $args ) ); |
|
55 | 55 | |
56 | 56 | } |
57 | 57 | |
58 | - /** |
|
59 | - * @param float $lat |
|
60 | - * @param float $lng |
|
61 | - * @param array $args |
|
62 | - * |
|
63 | - * @return Marker |
|
64 | - */ |
|
65 | - static function make_marker_by_position( $lat, $lng, $args = array() ) { |
|
58 | + /** |
|
59 | + * @param float $lat |
|
60 | + * @param float $lng |
|
61 | + * @param array $args |
|
62 | + * |
|
63 | + * @return Marker |
|
64 | + */ |
|
65 | + static function make_marker_by_position( $lat, $lng, $args = array() ) { |
|
66 | 66 | |
67 | - $marker = \Clubdeuce\WPGoogleMaps\Google_Maps::make_marker_by_position( $lat, $lng, $args ); |
|
68 | - return new Marker( array_merge( array( 'marker' => $marker ), $args ) ); |
|
67 | + $marker = \Clubdeuce\WPGoogleMaps\Google_Maps::make_marker_by_position( $lat, $lng, $args ); |
|
68 | + return new Marker( array_merge( array( 'marker' => $marker ), $args ) ); |
|
69 | 69 | |
70 | - } |
|
70 | + } |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | Google_Maps::on_load(); |