| @@ 13-56 (lines=44) @@ | ||
| 10 | * |
|
| 11 | * @mixin WPMap |
|
| 12 | */ |
|
| 13 | class Map_Model extends Model_Base { |
|
| 14 | ||
| 15 | /** |
|
| 16 | * @var WPMap |
|
| 17 | */ |
|
| 18 | protected $_map; |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @return bool |
|
| 22 | */ |
|
| 23 | function has_map() { |
|
| 24 | ||
| 25 | return $this->_has('_map' ); |
|
| 26 | ||
| 27 | } |
|
| 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; |
|
| 37 | ||
| 38 | do { |
|
| 39 | ||
| 40 | if ( property_exists( $this, "_{$method_name}" ) ) { |
|
| 41 | $property = "_{$method_name}"; |
|
| 42 | $value = $this->{$property}; |
|
| 43 | break; |
|
| 44 | } |
|
| 45 | ||
| 46 | if ( ! isset( $this->_map ) ) { |
|
| 47 | break; |
|
| 48 | } |
|
| 49 | ||
| 50 | $value = call_user_func_array( array( $this->_map, $method_name ), $args ); |
|
| 51 | ||
| 52 | } while ( false ); |
|
| 53 | ||
| 54 | return $value; |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| @@ 11-55 (lines=45) @@ | ||
| 8 | * |
|
| 9 | * @mixin Marker_Label; |
|
| 10 | */ |
|
| 11 | class Marker_Label_Model extends Model_Base { |
|
| 12 | ||
| 13 | /** |
|
| 14 | * @var \Clubdeuce\WPGoogleMaps\Marker_Label |
|
| 15 | */ |
|
| 16 | protected $_label; |
|
| 17 | ||
| 18 | /** |
|
| 19 | * @return bool |
|
| 20 | */ |
|
| 21 | function has_label() { |
|
| 22 | ||
| 23 | return $this->_has( '_label' ); |
|
| 24 | ||
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * @param string $method_name |
|
| 29 | * @param array $args |
|
| 30 | * |
|
| 31 | * @return mixed |
|
| 32 | */ |
|
| 33 | function __call( $method_name, $args = array() ) { |
|
| 34 | $value = null; |
|
| 35 | ||
| 36 | do { |
|
| 37 | ||
| 38 | if ( property_exists( $this, "_{$method_name}" ) ) { |
|
| 39 | $property = "_{$method_name}"; |
|
| 40 | $value = $this->{$property}; |
|
| 41 | break; |
|
| 42 | } |
|
| 43 | ||
| 44 | if ( ! isset( $this->_label ) ) { |
|
| 45 | break; |
|
| 46 | } |
|
| 47 | ||
| 48 | $value = call_user_func_array( array( $this->_label, $method_name ), $args ); |
|
| 49 | ||
| 50 | } while ( false ); |
|
| 51 | ||
| 52 | return $value; |
|
| 53 | } |
|
| 54 | ||
| 55 | } |
|
| 56 | ||