r111266 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111265‎ | r111266 | r111267 >
Date:21:49, 11 February 2012
Author:jeroendedauw
Status:ok
Tags:
Comment:
Follow up to r111264; update @since tags
Modified paths:
  • /trunk/phase3/includes/DBDataObject.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DBDataObject.php
@@ -50,7 +50,7 @@
5151 * The fields of the object.
5252 * field name (w/o prefix) => value
5353 *
54 - * @since 0.1
 54+ * @since 1.20
5555 * @var array
5656 */
5757 protected $fields = array( 'id' => null );
@@ -61,7 +61,7 @@
6262 * Settings this to false can prevent needless updating work in situations
6363 * such as deleting a university, which will then delete all it's courses.
6464 *
65 - * @since 0.1
 65+ * @since 1.20
6666 * @var bool
6767 */
6868 protected $updateSummaries = true;
@@ -71,7 +71,7 @@
7272 * This mode indicates that only summary fields got updated,
7373 * which allows for optimizations.
7474 *
75 - * @since 0.1
 75+ * @since 1.20
7676 * @var bool
7777 */
7878 protected $inSummaryMode = false;
@@ -89,7 +89,7 @@
9090 /**
9191 * Returns the name of the database table objects of this type are stored in.
9292 *
93 - * @since 0.1
 93+ * @since 1.20
9494 *
9595 * @throws MWException
9696 * @return string
@@ -107,7 +107,7 @@
108108 /**
109109 * Gets the db field prefix.
110110 *
111 - * @since 0.1
 111+ * @since 1.20
112112 *
113113 * @throws MWException
114114 * @return string
@@ -136,7 +136,7 @@
137137 * * bool
138138 * * array
139139 *
140 - * @since 0.1
 140+ * @since 1.20
141141 *
142142 * @throws MWException
143143 * @return array
@@ -149,7 +149,7 @@
150150 * Returns a list of default field values.
151151 * field name => field value
152152 *
153 - * @since 0.1
 153+ * @since 1.20
154154 *
155155 * @return array
156156 */
@@ -162,7 +162,7 @@
163163 * These are fields that cache computed values, such as the amount of linked objects of $type.
164164 * This is relevant as one might not want to do actions such as log changes when these get updated.
165165 *
166 - * @since 0.1
 166+ * @since 1.20
167167 *
168168 * @return array
169169 */
@@ -173,7 +173,7 @@
174174 /**
175175 * Constructor.
176176 *
177 - * @since 0.1
 177+ * @since 1.20
178178 *
179179 * @param array|null $fields
180180 * @param boolean $loadDefaults
@@ -193,7 +193,7 @@
194194 /**
195195 * Load the specified fields from the database.
196196 *
197 - * @since 0.1
 197+ * @since 1.20
198198 *
199199 * @param array|null $fields
200200 * @param boolean $override
@@ -238,7 +238,7 @@
239239 /**
240240 * Gets the value of a field.
241241 *
242 - * @since 0.1
 242+ * @since 1.20
243243 *
244244 * @param string $name
245245 * @param mixed $default
@@ -259,7 +259,7 @@
260260 /**
261261 * Gets the value of a field but first loads it if not done so already.
262262 *
263 - * @since 0.1
 263+ * @since 1.20
264264 *
265265 * @param string$name
266266 *
@@ -276,7 +276,7 @@
277277 /**
278278 * Remove a field.
279279 *
280 - * @since 0.1
 280+ * @since 1.20
281281 *
282282 * @param string $name
283283 */
@@ -287,7 +287,7 @@
288288 /**
289289 * Returns the objects database id.
290290 *
291 - * @since 0.1
 291+ * @since 1.20
292292 *
293293 * @return integer|null
294294 */
@@ -298,7 +298,7 @@
299299 /**
300300 * Sets the objects database id.
301301 *
302 - * @since 0.1
 302+ * @since 1.20
303303 *
304304 * @param integer|null $id
305305 */
@@ -309,7 +309,7 @@
310310 /**
311311 * Gets if a certain field is set.
312312 *
313 - * @since 0.1
 313+ * @since 1.20
314314 *
315315 * @param string $name
316316 *
@@ -322,7 +322,7 @@
323323 /**
324324 * Gets if the id field is set.
325325 *
326 - * @since 0.1
 326+ * @since 1.20
327327 *
328328 * @return boolean
329329 */
@@ -334,7 +334,7 @@
335335 /**
336336 * Sets multiple fields.
337337 *
338 - * @since 0.1
 338+ * @since 1.20
339339 *
340340 * @param array $fields The fields to set
341341 * @param boolean $override Override already set fields with the provided values?
@@ -350,7 +350,7 @@
351351 /**
352352 * Gets the fields => values to write to the table.
353353 *
354 - * @since 0.1
 354+ * @since 1.20
355355 *
356356 * @return array
357357 */
@@ -379,7 +379,7 @@
380380 * Serializes the object to an associative array which
381381 * can then easily be converted into JSON or similar.
382382 *
383 - * @since 0.1
 383+ * @since 1.20
384384 *
385385 * @param null|array $fields
386386 * @param boolean $incNullId
@@ -412,7 +412,7 @@
413413 /**
414414 * Load the default values, via getDefaults.
415415 *
416 - * @since 0.1
 416+ * @since 1.20
417417 *
418418 * @param boolean $override
419419 */
@@ -424,7 +424,7 @@
425425 * Writes the answer to the database, either updating it
426426 * when it already exists, or inserting it when it doesn't.
427427 *
428 - * @since 0.1
 428+ * @since 1.20
429429 *
430430 * @return boolean Success indicator
431431 */
@@ -439,7 +439,7 @@
440440 /**
441441 * Updates the object in the database.
442442 *
443 - * @since 0.1
 443+ * @since 1.20
444444 *
445445 * @return boolean Success indicator
446446 */
@@ -459,7 +459,7 @@
460460 /**
461461 * Inserts the object into the database.
462462 *
463 - * @since 0.1
 463+ * @since 1.20
464464 *
465465 * @return boolean Success indicator
466466 */
@@ -483,7 +483,7 @@
484484 /**
485485 * Removes the object from the database.
486486 *
487 - * @since 0.1
 487+ * @since 1.20
488488 *
489489 * @return boolean Success indicator
490490 */
@@ -502,7 +502,7 @@
503503 /**
504504 * Gets called before an object is removed from the database.
505505 *
506 - * @since 0.1
 506+ * @since 1.20
507507 */
508508 protected function beforeRemove() {
509509 $this->loadFields( $this->getBeforeRemoveFields(), false, true );
@@ -513,7 +513,7 @@
514514 * This method loads the fields of which the names have been returned by this one (or all fields if null is returned).
515515 * This allows for loading info needed after removal to get rid of linked data and the like.
516516 *
517 - * @since 0.1
 517+ * @since 1.20
518518 *
519519 * @return array|null
520520 */
@@ -525,7 +525,7 @@
526526 * Gets called after successfull removal.
527527 * Can be overriden to get rid of linked data.
528528 *
529 - * @since 0.1
 529+ * @since 1.20
530530 */
531531 protected function onRemoved() {
532532 $this->setField( 'id', null );
@@ -534,7 +534,7 @@
535535 /**
536536 * Return the names and values of the fields.
537537 *
538 - * @since 0.1
 538+ * @since 1.20
539539 *
540540 * @return array
541541 */
@@ -545,7 +545,7 @@
546546 /**
547547 * Return the names of the fields.
548548 *
549 - * @since 0.1
 549+ * @since 1.20
550550 *
551551 * @return array
552552 */
@@ -558,7 +558,7 @@
559559 * Strings can be provided for other types,
560560 * so this method can be called from unserialization handlers.
561561 *
562 - * @since 0.1
 562+ * @since 1.20
563563 *
564564 * @param string $name
565565 * @param mixed $value
@@ -613,7 +613,7 @@
614614 /**
615615 * Get a new instance of the class from an array.
616616 *
617 - * @since 0.1
 617+ * @since 1.20
618618 *
619619 * @param array $data
620620 * @param boolean $loadDefaults
@@ -648,7 +648,7 @@
649649 /**
650650 * Gets if the object can take a certain field.
651651 *
652 - * @since 0.1
 652+ * @since 1.20
653653 *
654654 * @param string $name
655655 *
@@ -662,7 +662,7 @@
663663 * Takes in a field or array of fields and returns an
664664 * array with their prefixed versions, ready for db usage.
665665 *
666 - * @since 0.1
 666+ * @since 1.20
667667 *
668668 * @param array|string $fields
669669 *
@@ -682,7 +682,7 @@
683683 * array( 'tablename', 'fieldname' )
684684 * Where table name is registered in $wgDBDataObjects.
685685 *
686 - * @since 0.1
 686+ * @since 1.20
687687 *
688688 * @param string|array $field
689689 *
@@ -724,7 +724,7 @@
725725 * array( array( 'tablename', 'fieldname' ), $value ),
726726 * );
727727 *
728 - * @since 0.1
 728+ * @since 1.20
729729 *
730730 * @param array $values
731731 *
@@ -758,7 +758,7 @@
759759 * that can be fed directly to the constructor or
760760 * to setFields.
761761 *
762 - * @since 0.1
 762+ * @since 1.20
763763 *
764764 * @param object $result
765765 *
@@ -775,7 +775,7 @@
776776 /**
777777 * Takes a field name with prefix and returns the unprefixed equivalent.
778778 *
779 - * @since 0.1
 779+ * @since 1.20
780780 *
781781 * @param string $fieldName
782782 *
@@ -788,7 +788,7 @@
789789 /**
790790 * Takes an array of field names with prefix and returns the unprefixed equivalent.
791791 *
792 - * @since 0.1
 792+ * @since 1.20
793793 *
794794 * @param array $fieldNames
795795 *
@@ -801,7 +801,7 @@
802802 /**
803803 * Get a new instance of the class from a database result.
804804 *
805 - * @since 0.1
 805+ * @since 1.20
806806 *
807807 * @param stdClass $result
808808 *
@@ -814,7 +814,7 @@
815815 /**
816816 * Removes the object from the database.
817817 *
818 - * @since 0.1
 818+ * @since 1.20
819819 *
820820 * @param array $conditions
821821 *
@@ -830,7 +830,7 @@
831831 /**
832832 * Add an amount (can be negative) to the specified field (needs to be numeric).
833833 *
834 - * @since 0.1
 834+ * @since 1.20
835835 *
836836 * @param string $field
837837 * @param integer $amount
@@ -871,7 +871,7 @@
872872 * Selects the the specified fields of the records matching the provided
873873 * conditions and returns them as DBDataObject. Field names get prefixed.
874874 *
875 - * @since 0.1
 875+ * @since 1.20
876876 *
877877 * @param array|string|null $fields
878878 * @param array $conditions
@@ -904,7 +904,7 @@
905905 * the first field and as value the second field.
906906 * If more then two fields are selected, each item will be an associative array.
907907 *
908 - * @since 0.1
 908+ * @since 1.20
909909 *
910910 * @param array|string|null $fields
911911 * @param array $conditions
@@ -961,7 +961,7 @@
962962 * Process the join conditions. This includes prefixing table and field names,
963963 * and adding of needed tables.
964964 *
965 - * @since 0.1
 965+ * @since 1.20
966966 *
967967 * @param array $joinConds Join conditions without prefixes and fields in array rather then string with equals sign.
968968 * @param array $tables List of tables to which the extra needed ones get added.
@@ -1005,7 +1005,7 @@
10061006 * Selects the the specified fields of the first matching record.
10071007 * Field names get prefixed.
10081008 *
1009 - * @since 0.1
 1009+ * @since 1.20
10101010 *
10111011 * @param array|string|null $fields
10121012 * @param array $conditions
@@ -1029,7 +1029,7 @@
10301030 * returns the same results (if there are any, if there are none, this method returns false).
10311031 * @see DBDataObject::selectFields
10321032 *
1033 - * @since 0.1
 1033+ * @since 1.20
10341034 *
10351035 * @param array|string|null $fields
10361036 * @param array $conditions
@@ -1051,7 +1051,7 @@
10521052 * Returns if there is at least one record matching the provided conditions.
10531053 * Condition field names get prefixed.
10541054 *
1055 - * @since 0.1
 1055+ * @since 1.20
10561056 *
10571057 * @param array $conditions
10581058 *
@@ -1065,7 +1065,7 @@
10661066 * Returns the amount of matching records.
10671067 * Condition field names get prefixed.
10681068 *
1069 - * @since 0.1
 1069+ * @since 1.20
10701070 *
10711071 * @param array $conditions
10721072 * @param array $options
@@ -1086,7 +1086,7 @@
10871087 * Selects the the specified fields of the records matching the provided
10881088 * conditions. Field names do NOT get prefixed.
10891089 *
1090 - * @since 0.1
 1090+ * @since 1.20
10911091 *
10921092 * @param array $fields
10931093 * @param array $conditions
@@ -1118,7 +1118,7 @@
11191119 * setting the fields that are keys in the $values param to
11201120 * their corresponding values.
11211121 *
1122 - * @since 0.1
 1122+ * @since 1.20
11231123 *
11241124 * @param array $values
11251125 * @param array $conditions
@@ -1139,7 +1139,7 @@
11401140 /**
11411141 * Return the names of the fields.
11421142 *
1143 - * @since 0.1
 1143+ * @since 1.20
11441144 *
11451145 * @return array
11461146 */
@@ -1152,7 +1152,7 @@
11531153 *
11541154 * field name => field description
11551155 *
1156 - * @since 0.1
 1156+ * @since 1.20
11571157 *
11581158 * @return array
11591159 */
@@ -1163,7 +1163,7 @@
11641164 /**
11651165 * Get API parameters for the fields supported by this object.
11661166 *
1167 - * @since 0.1
 1167+ * @since 1.20
11681168 *
11691169 * @param boolean $requireParams
11701170 * @param boolean $setDefaults
@@ -1212,7 +1212,7 @@
12131213 /**
12141214 * Computes and updates the values of the summary fields.
12151215 *
1216 - * @since 0.1
 1216+ * @since 1.20
12171217 *
12181218 * @param array|string|null $summaryFields
12191219 */
@@ -1223,7 +1223,7 @@
12241224 /**
12251225 * Computes the values of the summary fields of the objects matching the provided conditions.
12261226 *
1227 - * @since 0.1
 1227+ * @since 1.20
12281228 *
12291229 * @param array|string|null $summaryFields
12301230 * @param array $conditions
@@ -1243,7 +1243,7 @@
12441244 /**
12451245 * Sets the value for the @see $updateSummaries field.
12461246 *
1247 - * @since 0.1
 1247+ * @since 1.20
12481248 *
12491249 * @param boolean $update
12501250 */
@@ -1254,7 +1254,7 @@
12551255 /**
12561256 * Sets the value for the @see $inSummaryMode field.
12571257 *
1258 - * @since 0.1
 1258+ * @since 1.20
12591259 *
12601260 * @param boolean $update
12611261 */
@@ -1265,7 +1265,7 @@
12661266 /**
12671267 * Return if any fields got changed.
12681268 *
1269 - * @since 0.1
 1269+ * @since 1.20
12701270 *
12711271 * @param DBDataObject $object
12721272 * @param boolean $excludeSummaryFields When set to true, summary field changes are ignored.

Follow-up revisions

RevisionCommit summaryAuthorDate
r111292follow up to r111266, missed these :/jeroendedauw13:58, 12 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111264adding DBDataObject class after having some people review it and posting on t...jeroendedauw21:34, 11 February 2012

Status & tagging log