Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php |
— | — | @@ -18,11 +18,17 @@ |
19 | 19 | * |
20 | 20 | * @author Jeroen De Dauw |
21 | 21 | * |
| 22 | + * @since 0.6 |
| 23 | + * |
22 | 24 | * @ingroup SemanticMaps |
23 | 25 | */ |
24 | 26 | class SMGeoCoordsValueDescription extends SMWValueDescription { |
25 | 27 | |
26 | 28 | /** |
| 29 | + * Constructor. |
| 30 | + * |
| 31 | + * @since 0.6 |
| 32 | + * |
27 | 33 | * @param SMGeoCoordsValue $dataValue |
28 | 34 | */ |
29 | 35 | public function __construct( SMGeoCoordsValue $dataValue, $comparator ) { |
— | — | @@ -32,6 +38,8 @@ |
33 | 39 | /** |
34 | 40 | * @see SMWDescription::getQueryString |
35 | 41 | * |
| 42 | + * @since 0.6 |
| 43 | + * |
36 | 44 | * @param Boolean $asvalue |
37 | 45 | */ |
38 | 46 | public function getQueryString( $asValue = false ) { |
— | — | @@ -46,6 +54,8 @@ |
47 | 55 | /** |
48 | 56 | * @see SMWDescription::getSQLCondition |
49 | 57 | * |
| 58 | + * @since 0.6 |
| 59 | + * |
50 | 60 | * @param string $tableName |
51 | 61 | * @param array $fieldNames |
52 | 62 | * @param DatabaseBase or Database $dbs |
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_AreaValueDescription.php |
— | — | @@ -22,11 +22,22 @@ |
23 | 23 | * |
24 | 24 | * TODO: would be awesome to use Spatial Extensions to select coordinates |
25 | 25 | * |
| 26 | + * @since 0.6 |
| 27 | + * |
26 | 28 | * @ingroup SemanticMaps |
27 | 29 | */ |
28 | 30 | class SMAreaValueDescription extends SMWValueDescription { |
29 | 31 | protected $mBounds = false; |
30 | 32 | |
| 33 | + /** |
| 34 | + * Constructor. |
| 35 | + * |
| 36 | + * @since 0.6 |
| 37 | + * |
| 38 | + * @param SMGeoCoordsValue $dataValue |
| 39 | + * @param string $comparator |
| 40 | + * @param string $radius |
| 41 | + */ |
31 | 42 | public function __construct( SMGeoCoordsValue $dataValue, $comparator, $radius ) { |
32 | 43 | parent::__construct( $dataValue, $comparator ); |
33 | 44 | |
— | — | @@ -39,6 +50,8 @@ |
40 | 51 | /** |
41 | 52 | * Sets the mBounds fields to an array returned by SMAreaValueDescription::getBoundingBox. |
42 | 53 | * |
| 54 | + * @since 0.6 |
| 55 | + * |
43 | 56 | * @param SMGeoCoordsValue $dataValue |
44 | 57 | * @param string $radius |
45 | 58 | */ |
— | — | @@ -52,6 +65,8 @@ |
53 | 66 | /** |
54 | 67 | * @see SMWDescription:getQueryString |
55 | 68 | * |
| 69 | + * @since 0.6 |
| 70 | + * |
56 | 71 | * @param Boolean $asvalue |
57 | 72 | */ |
58 | 73 | public function getQueryString( $asValue = false ) { |
— | — | @@ -65,12 +80,16 @@ |
66 | 81 | |
67 | 82 | /** |
68 | 83 | * @see SMWDescription:prune |
| 84 | + * |
| 85 | + * @since 0.6 |
69 | 86 | */ |
70 | 87 | public function prune( &$maxsize, &$maxdepth, &$log ) { |
71 | 88 | if ( ( $maxsize < $this->getSize() ) || ( $maxdepth < $this->getDepth() ) ) { |
72 | 89 | $log[] = $this->getQueryString(); |
| 90 | + |
73 | 91 | $result = new SMWThingDescription(); |
74 | 92 | $result->setPrintRequests( $this->getPrintRequests() ); |
| 93 | + |
75 | 94 | return $result; |
76 | 95 | } else { |
77 | 96 | $maxsize = $maxsize - $this->getSize(); |
— | — | @@ -81,6 +100,10 @@ |
82 | 101 | |
83 | 102 | /** |
84 | 103 | * Returns the bounds of the area. |
| 104 | + * |
| 105 | + * @since 0.6 |
| 106 | + * |
| 107 | + * @return array |
85 | 108 | */ |
86 | 109 | public function getBounds() { |
87 | 110 | return $this->mBounds; |
— | — | @@ -89,11 +112,13 @@ |
90 | 113 | /** |
91 | 114 | * @see SMWDescription::getSQLCondition |
92 | 115 | * |
| 116 | + * @since 0.6 |
| 117 | + * |
93 | 118 | * @param string $tableName |
94 | 119 | * @param array $fieldNames |
95 | 120 | * @param DatabaseBase or Database $dbs |
96 | 121 | * |
97 | | - * @return true |
| 122 | + * @return string or false |
98 | 123 | */ |
99 | 124 | public function getSQLCondition( $tableName, array $fieldNames, $dbs ) { |
100 | 125 | global $smgUseSpatialExtensions; |
— | — | @@ -140,6 +165,8 @@ |
141 | 166 | /** |
142 | 167 | * Returns the lat and lon limits of a bounding box around a circle defined by the provided parameters. |
143 | 168 | * |
| 169 | + * @since 0.6 |
| 170 | + * |
144 | 171 | * @param array $centerCoordinates Array containing non-directional float coordinates with lat and lon keys. |
145 | 172 | * @param float $circleRadius The radidus of the circle to create a bounding box for, in m. |
146 | 173 | * |
— | — | @@ -161,8 +188,13 @@ |
162 | 189 | |
163 | 190 | /** |
164 | 191 | * Returns a boolean indicating if MapsGeoFunctions is available. |
| 192 | + * |
| 193 | + * @since 0.6 |
| 194 | + * |
| 195 | + * @return boolean |
165 | 196 | */ |
166 | 197 | protected static function geoFunctionsAreAvailable() { |
167 | 198 | return class_exists( 'MapsGeoFunctions' ); |
168 | 199 | } |
| 200 | + |
169 | 201 | } |
\ No newline at end of file |