Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Record.php |
— | — | @@ -187,27 +187,43 @@ |
188 | 188 | ////// Additional API for value lists |
189 | 189 | |
190 | 190 | /** |
| 191 | + * @deprecated as of 1.0, use getDataItems instead |
| 192 | + * |
| 193 | + * @return array of SMWDataItem |
| 194 | + */ |
| 195 | + public function getDVs() { |
| 196 | + return $this->getDataItems(); |
| 197 | + } |
| 198 | + |
| 199 | + /** |
191 | 200 | * Create a list (array with numeric keys) containing the datavalue |
192 | 201 | * objects that this SMWRecordValue object holds. Values that are not |
193 | 202 | * present are set to null. Note that the first index in the array is |
194 | 203 | * 0, not 1. |
195 | 204 | * |
196 | | - * @todo This method should be renamed to getDataItems(). |
| 205 | + * @since 1.6 |
| 206 | + * |
197 | 207 | * @return array of SMWDataItem |
198 | 208 | */ |
199 | | - public function getDVs() { |
200 | | - if ( !$this->isValid() ) return array(); |
201 | | - $result = array(); |
202 | | - $semanticData = $this->m_dataitem->getSemanticData(); |
203 | | - foreach ( $semanticData->getProperties() as $prop ) { |
204 | | - $propname = $prop->getPropertyID(); |
205 | | - $propnum = substr( $propname, 1 ); |
206 | | - if ( ( $propname != false ) && ( is_numeric( $propnum ) ) ) { |
207 | | - $propertyvalues = $semanticData->getPropertyValues( $prop ); // combining this with next line violates PHP strict standards |
208 | | - $result[( $propnum - 1 )] = reset( $propertyvalues ); |
209 | | - } |
| 209 | + public function getDataItems() { |
| 210 | + $dataItems = array(); |
| 211 | + |
| 212 | + if ( $this->isValid() ) { |
| 213 | + $semanticData = $this->m_dataitem->getSemanticData(); |
| 214 | + |
| 215 | + foreach ( $semanticData->getProperties() as $prop ) { |
| 216 | + $propname = $prop->getPropertyID(); |
| 217 | + $propnum = substr( $propname, 1 ); |
| 218 | + |
| 219 | + if ( ( $propname != false ) && ( is_numeric( $propnum ) ) ) { |
| 220 | + // Combining this with next line violates PHP strict standards. |
| 221 | + $propertyvalues = $semanticData->getPropertyValues( $prop ); |
| 222 | + $result[( $propnum - 1 )] = reset( $propertyvalues ); |
| 223 | + } |
| 224 | + } |
210 | 225 | } |
211 | | - return $result; |
| 226 | + |
| 227 | + return $dataItems; |
212 | 228 | } |
213 | 229 | |
214 | 230 | /** |