1 | <?php |
||
15 | class PolygonHandler { |
||
16 | |||
17 | /** |
||
18 | * The string used to store this value as a string in SMW. |
||
19 | * |
||
20 | * @since 2.1 |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $text; |
||
25 | |||
26 | /** |
||
27 | * The string used to store this value as an object. |
||
28 | * |
||
29 | * @since 2.1 |
||
30 | * |
||
31 | * @var object or null |
||
32 | */ |
||
33 | protected $value = null; |
||
34 | |||
35 | /** |
||
36 | * The array of error messages occurred in parsing. |
||
37 | * |
||
38 | * @since 2.1 |
||
39 | * |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $errors = []; |
||
43 | |||
44 | /** |
||
45 | * Array of classes used to validate different Geographic shapes. |
||
46 | * |
||
47 | * @since 2.1 |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $validatorClasses = [ |
||
52 | 'locations' => 'LocationValidator', |
||
53 | 'lines' => 'LineValidator', |
||
54 | 'polygons' => 'PolygonValidator', |
||
55 | 'circles' => 'CircleValidator', |
||
56 | 'rectangles' => 'RectangleValidator' |
||
57 | ]; |
||
58 | |||
59 | /** |
||
60 | * Array of classes of different Geographic shapes. |
||
61 | * |
||
62 | * @since 2.1 |
||
63 | * |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $geoClasses = [ |
||
67 | 'locations' => 'MapsLocation', |
||
68 | 'lines' => 'MapsLine', |
||
69 | 'polygons' => 'MapsPolygon', |
||
70 | 'circles' => 'MapsCircle', |
||
71 | 'rectangles' => 'MapsRectanlge' |
||
72 | ]; |
||
73 | |||
74 | /** |
||
75 | * NOTE: These need to be changed as Manipulations are depreceated. |
||
76 | * Array of classes for param handling of different Geographic shapes. |
||
77 | * |
||
78 | * @since 2.1 |
||
79 | * |
||
80 | * @var array |
||
81 | */ |
||
82 | protected $paramClasses = [ |
||
83 | 'locations' => 'MapsParamLocation', |
||
84 | 'lines' => 'MapsParamLine', |
||
85 | 'polygons' => 'MapsParamPolygon', |
||
86 | 'circles' => 'MapsParamCircle', |
||
87 | 'rectangles' => 'MapsParamRectangle' |
||
88 | ]; |
||
89 | |||
90 | /** |
||
91 | * Constructor. |
||
92 | * |
||
93 | * @since 2.1 |
||
94 | * |
||
95 | * @param string $text |
||
96 | */ |
||
97 | public function __construct( $text ) { |
||
100 | |||
101 | public function getGeoType() { |
||
105 | |||
106 | public function getValidationErrors() { |
||
110 | |||
111 | protected function validateText() { |
||
121 | |||
122 | /** |
||
123 | * Gets an object of the model class the string represents. |
||
124 | * |
||
125 | * @since 2.1 |
||
126 | */ |
||
127 | public function shapeFromText() { |
||
138 | } |
||
139 |