Completed
Push — master ( 643987...ab0124 )
by Daryl
01:58
created

Map_Model::add_markers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Clubdeuce\WPLib\Components\GoogleMaps;
4
5
/**
6
 * Class Map_Model
7
 * @package Clubdeuce\WPLib\Components\GoogleMaps
8
 */
9
class Map_Model extends \WPLib_Model_Base {
10
11
    /**
12
     * @var array
13
     */
14
    protected $_center;
15
16
    /**
17
     * @var Marker[]
18
     */
19
    protected $_markers = array();
20
21
    /**
22
     * @var int
23
     */
24
    protected $_zoom = 5;
25
26
    /**
27
     * @param Marker $marker
28
     */
29
    function add_marker( $marker ) {
30
31
        $this->_markers[] = $marker;
32
33
    }
34
35
    /**
36
     * @param Marker[] $markers
37
     */
38
    function add_markers( $markers ) {
39
40
        $this->_markers = array_merge( $this->_markers, $markers );
41
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    function center() {
48
49
        return $this->_center;
50
51
    }
52
53
    /**
54
     * @return Marker[]
55
     */
56
    function markers() {
57
58
        return $this->_markers;
59
60
    }
61
62
    /**
63
     * @return int
64
     */
65
    function zoom() {
66
67
        return $this->_zoom;
68
69
    }
70
71
}
72