Index: trunk/phase3/includes/DBDataObject.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | * The fields of the object. |
52 | 52 | * field name (w/o prefix) => value |
53 | 53 | * |
54 | | - * @since 0.1 |
| 54 | + * @since 1.20 |
55 | 55 | * @var array |
56 | 56 | */ |
57 | 57 | protected $fields = array( 'id' => null ); |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | * Settings this to false can prevent needless updating work in situations |
63 | 63 | * such as deleting a university, which will then delete all it's courses. |
64 | 64 | * |
65 | | - * @since 0.1 |
| 65 | + * @since 1.20 |
66 | 66 | * @var bool |
67 | 67 | */ |
68 | 68 | protected $updateSummaries = true; |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | * This mode indicates that only summary fields got updated, |
73 | 73 | * which allows for optimizations. |
74 | 74 | * |
75 | | - * @since 0.1 |
| 75 | + * @since 1.20 |
76 | 76 | * @var bool |
77 | 77 | */ |
78 | 78 | protected $inSummaryMode = false; |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | /** |
91 | 91 | * Returns the name of the database table objects of this type are stored in. |
92 | 92 | * |
93 | | - * @since 0.1 |
| 93 | + * @since 1.20 |
94 | 94 | * |
95 | 95 | * @throws MWException |
96 | 96 | * @return string |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | /** |
109 | 109 | * Gets the db field prefix. |
110 | 110 | * |
111 | | - * @since 0.1 |
| 111 | + * @since 1.20 |
112 | 112 | * |
113 | 113 | * @throws MWException |
114 | 114 | * @return string |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | * * bool |
138 | 138 | * * array |
139 | 139 | * |
140 | | - * @since 0.1 |
| 140 | + * @since 1.20 |
141 | 141 | * |
142 | 142 | * @throws MWException |
143 | 143 | * @return array |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | * Returns a list of default field values. |
151 | 151 | * field name => field value |
152 | 152 | * |
153 | | - * @since 0.1 |
| 153 | + * @since 1.20 |
154 | 154 | * |
155 | 155 | * @return array |
156 | 156 | */ |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | * These are fields that cache computed values, such as the amount of linked objects of $type. |
164 | 164 | * This is relevant as one might not want to do actions such as log changes when these get updated. |
165 | 165 | * |
166 | | - * @since 0.1 |
| 166 | + * @since 1.20 |
167 | 167 | * |
168 | 168 | * @return array |
169 | 169 | */ |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | /** |
175 | 175 | * Constructor. |
176 | 176 | * |
177 | | - * @since 0.1 |
| 177 | + * @since 1.20 |
178 | 178 | * |
179 | 179 | * @param array|null $fields |
180 | 180 | * @param boolean $loadDefaults |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | /** |
195 | 195 | * Load the specified fields from the database. |
196 | 196 | * |
197 | | - * @since 0.1 |
| 197 | + * @since 1.20 |
198 | 198 | * |
199 | 199 | * @param array|null $fields |
200 | 200 | * @param boolean $override |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | /** |
240 | 240 | * Gets the value of a field. |
241 | 241 | * |
242 | | - * @since 0.1 |
| 242 | + * @since 1.20 |
243 | 243 | * |
244 | 244 | * @param string $name |
245 | 245 | * @param mixed $default |
— | — | @@ -259,7 +259,7 @@ |
260 | 260 | /** |
261 | 261 | * Gets the value of a field but first loads it if not done so already. |
262 | 262 | * |
263 | | - * @since 0.1 |
| 263 | + * @since 1.20 |
264 | 264 | * |
265 | 265 | * @param string$name |
266 | 266 | * |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | /** |
278 | 278 | * Remove a field. |
279 | 279 | * |
280 | | - * @since 0.1 |
| 280 | + * @since 1.20 |
281 | 281 | * |
282 | 282 | * @param string $name |
283 | 283 | */ |
— | — | @@ -287,7 +287,7 @@ |
288 | 288 | /** |
289 | 289 | * Returns the objects database id. |
290 | 290 | * |
291 | | - * @since 0.1 |
| 291 | + * @since 1.20 |
292 | 292 | * |
293 | 293 | * @return integer|null |
294 | 294 | */ |
— | — | @@ -298,7 +298,7 @@ |
299 | 299 | /** |
300 | 300 | * Sets the objects database id. |
301 | 301 | * |
302 | | - * @since 0.1 |
| 302 | + * @since 1.20 |
303 | 303 | * |
304 | 304 | * @param integer|null $id |
305 | 305 | */ |
— | — | @@ -309,7 +309,7 @@ |
310 | 310 | /** |
311 | 311 | * Gets if a certain field is set. |
312 | 312 | * |
313 | | - * @since 0.1 |
| 313 | + * @since 1.20 |
314 | 314 | * |
315 | 315 | * @param string $name |
316 | 316 | * |
— | — | @@ -322,7 +322,7 @@ |
323 | 323 | /** |
324 | 324 | * Gets if the id field is set. |
325 | 325 | * |
326 | | - * @since 0.1 |
| 326 | + * @since 1.20 |
327 | 327 | * |
328 | 328 | * @return boolean |
329 | 329 | */ |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | /** |
336 | 336 | * Sets multiple fields. |
337 | 337 | * |
338 | | - * @since 0.1 |
| 338 | + * @since 1.20 |
339 | 339 | * |
340 | 340 | * @param array $fields The fields to set |
341 | 341 | * @param boolean $override Override already set fields with the provided values? |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | /** |
352 | 352 | * Gets the fields => values to write to the table. |
353 | 353 | * |
354 | | - * @since 0.1 |
| 354 | + * @since 1.20 |
355 | 355 | * |
356 | 356 | * @return array |
357 | 357 | */ |
— | — | @@ -379,7 +379,7 @@ |
380 | 380 | * Serializes the object to an associative array which |
381 | 381 | * can then easily be converted into JSON or similar. |
382 | 382 | * |
383 | | - * @since 0.1 |
| 383 | + * @since 1.20 |
384 | 384 | * |
385 | 385 | * @param null|array $fields |
386 | 386 | * @param boolean $incNullId |
— | — | @@ -412,7 +412,7 @@ |
413 | 413 | /** |
414 | 414 | * Load the default values, via getDefaults. |
415 | 415 | * |
416 | | - * @since 0.1 |
| 416 | + * @since 1.20 |
417 | 417 | * |
418 | 418 | * @param boolean $override |
419 | 419 | */ |
— | — | @@ -424,7 +424,7 @@ |
425 | 425 | * Writes the answer to the database, either updating it |
426 | 426 | * when it already exists, or inserting it when it doesn't. |
427 | 427 | * |
428 | | - * @since 0.1 |
| 428 | + * @since 1.20 |
429 | 429 | * |
430 | 430 | * @return boolean Success indicator |
431 | 431 | */ |
— | — | @@ -439,7 +439,7 @@ |
440 | 440 | /** |
441 | 441 | * Updates the object in the database. |
442 | 442 | * |
443 | | - * @since 0.1 |
| 443 | + * @since 1.20 |
444 | 444 | * |
445 | 445 | * @return boolean Success indicator |
446 | 446 | */ |
— | — | @@ -459,7 +459,7 @@ |
460 | 460 | /** |
461 | 461 | * Inserts the object into the database. |
462 | 462 | * |
463 | | - * @since 0.1 |
| 463 | + * @since 1.20 |
464 | 464 | * |
465 | 465 | * @return boolean Success indicator |
466 | 466 | */ |
— | — | @@ -483,7 +483,7 @@ |
484 | 484 | /** |
485 | 485 | * Removes the object from the database. |
486 | 486 | * |
487 | | - * @since 0.1 |
| 487 | + * @since 1.20 |
488 | 488 | * |
489 | 489 | * @return boolean Success indicator |
490 | 490 | */ |
— | — | @@ -502,7 +502,7 @@ |
503 | 503 | /** |
504 | 504 | * Gets called before an object is removed from the database. |
505 | 505 | * |
506 | | - * @since 0.1 |
| 506 | + * @since 1.20 |
507 | 507 | */ |
508 | 508 | protected function beforeRemove() { |
509 | 509 | $this->loadFields( $this->getBeforeRemoveFields(), false, true ); |
— | — | @@ -513,7 +513,7 @@ |
514 | 514 | * This method loads the fields of which the names have been returned by this one (or all fields if null is returned). |
515 | 515 | * This allows for loading info needed after removal to get rid of linked data and the like. |
516 | 516 | * |
517 | | - * @since 0.1 |
| 517 | + * @since 1.20 |
518 | 518 | * |
519 | 519 | * @return array|null |
520 | 520 | */ |
— | — | @@ -525,7 +525,7 @@ |
526 | 526 | * Gets called after successfull removal. |
527 | 527 | * Can be overriden to get rid of linked data. |
528 | 528 | * |
529 | | - * @since 0.1 |
| 529 | + * @since 1.20 |
530 | 530 | */ |
531 | 531 | protected function onRemoved() { |
532 | 532 | $this->setField( 'id', null ); |
— | — | @@ -534,7 +534,7 @@ |
535 | 535 | /** |
536 | 536 | * Return the names and values of the fields. |
537 | 537 | * |
538 | | - * @since 0.1 |
| 538 | + * @since 1.20 |
539 | 539 | * |
540 | 540 | * @return array |
541 | 541 | */ |
— | — | @@ -545,7 +545,7 @@ |
546 | 546 | /** |
547 | 547 | * Return the names of the fields. |
548 | 548 | * |
549 | | - * @since 0.1 |
| 549 | + * @since 1.20 |
550 | 550 | * |
551 | 551 | * @return array |
552 | 552 | */ |
— | — | @@ -558,7 +558,7 @@ |
559 | 559 | * Strings can be provided for other types, |
560 | 560 | * so this method can be called from unserialization handlers. |
561 | 561 | * |
562 | | - * @since 0.1 |
| 562 | + * @since 1.20 |
563 | 563 | * |
564 | 564 | * @param string $name |
565 | 565 | * @param mixed $value |
— | — | @@ -613,7 +613,7 @@ |
614 | 614 | /** |
615 | 615 | * Get a new instance of the class from an array. |
616 | 616 | * |
617 | | - * @since 0.1 |
| 617 | + * @since 1.20 |
618 | 618 | * |
619 | 619 | * @param array $data |
620 | 620 | * @param boolean $loadDefaults |
— | — | @@ -648,7 +648,7 @@ |
649 | 649 | /** |
650 | 650 | * Gets if the object can take a certain field. |
651 | 651 | * |
652 | | - * @since 0.1 |
| 652 | + * @since 1.20 |
653 | 653 | * |
654 | 654 | * @param string $name |
655 | 655 | * |
— | — | @@ -662,7 +662,7 @@ |
663 | 663 | * Takes in a field or array of fields and returns an |
664 | 664 | * array with their prefixed versions, ready for db usage. |
665 | 665 | * |
666 | | - * @since 0.1 |
| 666 | + * @since 1.20 |
667 | 667 | * |
668 | 668 | * @param array|string $fields |
669 | 669 | * |
— | — | @@ -682,7 +682,7 @@ |
683 | 683 | * array( 'tablename', 'fieldname' ) |
684 | 684 | * Where table name is registered in $wgDBDataObjects. |
685 | 685 | * |
686 | | - * @since 0.1 |
| 686 | + * @since 1.20 |
687 | 687 | * |
688 | 688 | * @param string|array $field |
689 | 689 | * |
— | — | @@ -724,7 +724,7 @@ |
725 | 725 | * array( array( 'tablename', 'fieldname' ), $value ), |
726 | 726 | * ); |
727 | 727 | * |
728 | | - * @since 0.1 |
| 728 | + * @since 1.20 |
729 | 729 | * |
730 | 730 | * @param array $values |
731 | 731 | * |
— | — | @@ -758,7 +758,7 @@ |
759 | 759 | * that can be fed directly to the constructor or |
760 | 760 | * to setFields. |
761 | 761 | * |
762 | | - * @since 0.1 |
| 762 | + * @since 1.20 |
763 | 763 | * |
764 | 764 | * @param object $result |
765 | 765 | * |
— | — | @@ -775,7 +775,7 @@ |
776 | 776 | /** |
777 | 777 | * Takes a field name with prefix and returns the unprefixed equivalent. |
778 | 778 | * |
779 | | - * @since 0.1 |
| 779 | + * @since 1.20 |
780 | 780 | * |
781 | 781 | * @param string $fieldName |
782 | 782 | * |
— | — | @@ -788,7 +788,7 @@ |
789 | 789 | /** |
790 | 790 | * Takes an array of field names with prefix and returns the unprefixed equivalent. |
791 | 791 | * |
792 | | - * @since 0.1 |
| 792 | + * @since 1.20 |
793 | 793 | * |
794 | 794 | * @param array $fieldNames |
795 | 795 | * |
— | — | @@ -801,7 +801,7 @@ |
802 | 802 | /** |
803 | 803 | * Get a new instance of the class from a database result. |
804 | 804 | * |
805 | | - * @since 0.1 |
| 805 | + * @since 1.20 |
806 | 806 | * |
807 | 807 | * @param stdClass $result |
808 | 808 | * |
— | — | @@ -814,7 +814,7 @@ |
815 | 815 | /** |
816 | 816 | * Removes the object from the database. |
817 | 817 | * |
818 | | - * @since 0.1 |
| 818 | + * @since 1.20 |
819 | 819 | * |
820 | 820 | * @param array $conditions |
821 | 821 | * |
— | — | @@ -830,7 +830,7 @@ |
831 | 831 | /** |
832 | 832 | * Add an amount (can be negative) to the specified field (needs to be numeric). |
833 | 833 | * |
834 | | - * @since 0.1 |
| 834 | + * @since 1.20 |
835 | 835 | * |
836 | 836 | * @param string $field |
837 | 837 | * @param integer $amount |
— | — | @@ -871,7 +871,7 @@ |
872 | 872 | * Selects the the specified fields of the records matching the provided |
873 | 873 | * conditions and returns them as DBDataObject. Field names get prefixed. |
874 | 874 | * |
875 | | - * @since 0.1 |
| 875 | + * @since 1.20 |
876 | 876 | * |
877 | 877 | * @param array|string|null $fields |
878 | 878 | * @param array $conditions |
— | — | @@ -904,7 +904,7 @@ |
905 | 905 | * the first field and as value the second field. |
906 | 906 | * If more then two fields are selected, each item will be an associative array. |
907 | 907 | * |
908 | | - * @since 0.1 |
| 908 | + * @since 1.20 |
909 | 909 | * |
910 | 910 | * @param array|string|null $fields |
911 | 911 | * @param array $conditions |
— | — | @@ -961,7 +961,7 @@ |
962 | 962 | * Process the join conditions. This includes prefixing table and field names, |
963 | 963 | * and adding of needed tables. |
964 | 964 | * |
965 | | - * @since 0.1 |
| 965 | + * @since 1.20 |
966 | 966 | * |
967 | 967 | * @param array $joinConds Join conditions without prefixes and fields in array rather then string with equals sign. |
968 | 968 | * @param array $tables List of tables to which the extra needed ones get added. |
— | — | @@ -1005,7 +1005,7 @@ |
1006 | 1006 | * Selects the the specified fields of the first matching record. |
1007 | 1007 | * Field names get prefixed. |
1008 | 1008 | * |
1009 | | - * @since 0.1 |
| 1009 | + * @since 1.20 |
1010 | 1010 | * |
1011 | 1011 | * @param array|string|null $fields |
1012 | 1012 | * @param array $conditions |
— | — | @@ -1029,7 +1029,7 @@ |
1030 | 1030 | * returns the same results (if there are any, if there are none, this method returns false). |
1031 | 1031 | * @see DBDataObject::selectFields |
1032 | 1032 | * |
1033 | | - * @since 0.1 |
| 1033 | + * @since 1.20 |
1034 | 1034 | * |
1035 | 1035 | * @param array|string|null $fields |
1036 | 1036 | * @param array $conditions |
— | — | @@ -1051,7 +1051,7 @@ |
1052 | 1052 | * Returns if there is at least one record matching the provided conditions. |
1053 | 1053 | * Condition field names get prefixed. |
1054 | 1054 | * |
1055 | | - * @since 0.1 |
| 1055 | + * @since 1.20 |
1056 | 1056 | * |
1057 | 1057 | * @param array $conditions |
1058 | 1058 | * |
— | — | @@ -1065,7 +1065,7 @@ |
1066 | 1066 | * Returns the amount of matching records. |
1067 | 1067 | * Condition field names get prefixed. |
1068 | 1068 | * |
1069 | | - * @since 0.1 |
| 1069 | + * @since 1.20 |
1070 | 1070 | * |
1071 | 1071 | * @param array $conditions |
1072 | 1072 | * @param array $options |
— | — | @@ -1086,7 +1086,7 @@ |
1087 | 1087 | * Selects the the specified fields of the records matching the provided |
1088 | 1088 | * conditions. Field names do NOT get prefixed. |
1089 | 1089 | * |
1090 | | - * @since 0.1 |
| 1090 | + * @since 1.20 |
1091 | 1091 | * |
1092 | 1092 | * @param array $fields |
1093 | 1093 | * @param array $conditions |
— | — | @@ -1118,7 +1118,7 @@ |
1119 | 1119 | * setting the fields that are keys in the $values param to |
1120 | 1120 | * their corresponding values. |
1121 | 1121 | * |
1122 | | - * @since 0.1 |
| 1122 | + * @since 1.20 |
1123 | 1123 | * |
1124 | 1124 | * @param array $values |
1125 | 1125 | * @param array $conditions |
— | — | @@ -1139,7 +1139,7 @@ |
1140 | 1140 | /** |
1141 | 1141 | * Return the names of the fields. |
1142 | 1142 | * |
1143 | | - * @since 0.1 |
| 1143 | + * @since 1.20 |
1144 | 1144 | * |
1145 | 1145 | * @return array |
1146 | 1146 | */ |
— | — | @@ -1152,7 +1152,7 @@ |
1153 | 1153 | * |
1154 | 1154 | * field name => field description |
1155 | 1155 | * |
1156 | | - * @since 0.1 |
| 1156 | + * @since 1.20 |
1157 | 1157 | * |
1158 | 1158 | * @return array |
1159 | 1159 | */ |
— | — | @@ -1163,7 +1163,7 @@ |
1164 | 1164 | /** |
1165 | 1165 | * Get API parameters for the fields supported by this object. |
1166 | 1166 | * |
1167 | | - * @since 0.1 |
| 1167 | + * @since 1.20 |
1168 | 1168 | * |
1169 | 1169 | * @param boolean $requireParams |
1170 | 1170 | * @param boolean $setDefaults |
— | — | @@ -1212,7 +1212,7 @@ |
1213 | 1213 | /** |
1214 | 1214 | * Computes and updates the values of the summary fields. |
1215 | 1215 | * |
1216 | | - * @since 0.1 |
| 1216 | + * @since 1.20 |
1217 | 1217 | * |
1218 | 1218 | * @param array|string|null $summaryFields |
1219 | 1219 | */ |
— | — | @@ -1223,7 +1223,7 @@ |
1224 | 1224 | /** |
1225 | 1225 | * Computes the values of the summary fields of the objects matching the provided conditions. |
1226 | 1226 | * |
1227 | | - * @since 0.1 |
| 1227 | + * @since 1.20 |
1228 | 1228 | * |
1229 | 1229 | * @param array|string|null $summaryFields |
1230 | 1230 | * @param array $conditions |
— | — | @@ -1243,7 +1243,7 @@ |
1244 | 1244 | /** |
1245 | 1245 | * Sets the value for the @see $updateSummaries field. |
1246 | 1246 | * |
1247 | | - * @since 0.1 |
| 1247 | + * @since 1.20 |
1248 | 1248 | * |
1249 | 1249 | * @param boolean $update |
1250 | 1250 | */ |
— | — | @@ -1254,7 +1254,7 @@ |
1255 | 1255 | /** |
1256 | 1256 | * Sets the value for the @see $inSummaryMode field. |
1257 | 1257 | * |
1258 | | - * @since 0.1 |
| 1258 | + * @since 1.20 |
1259 | 1259 | * |
1260 | 1260 | * @param boolean $update |
1261 | 1261 | */ |
— | — | @@ -1265,7 +1265,7 @@ |
1266 | 1266 | /** |
1267 | 1267 | * Return if any fields got changed. |
1268 | 1268 | * |
1269 | | - * @since 0.1 |
| 1269 | + * @since 1.20 |
1270 | 1270 | * |
1271 | 1271 | * @param DBDataObject $object |
1272 | 1272 | * @param boolean $excludeSummaryFields When set to true, summary field changes are ignored. |