Change-Id: I5c752f9446ef78f08c457e9758ebf9e0b79a0c37
* @return array Names of the groups the user has belonged to.
*/
public function getFormerGroups() {
+ $this->load();
+
if ( is_null( $this->mFormerGroups ) ) {
- $dbr = wfGetDB( DB_MASTER );
+ $dbr = ( $this->queryFlagsUsed & self::READ_LATEST )
+ ? wfGetDB( DB_MASTER )
+ : wfGetDB( DB_SLAVE );
$res = $dbr->select( 'user_former_groups',
array( 'ufg_group' ),
array( 'ufg_user' => $this->mId ),
$this->mFormerGroups[] = $row->ufg_group;
}
}
+
return $this->mFormerGroups;
}