Index: trunk/extensions/Translate/utils/TranslateMetadata.php |
— | — | @@ -11,27 +11,28 @@ |
12 | 12 | */ |
13 | 13 | |
14 | 14 | class TranslateMetadata { |
15 | | - /* |
| 15 | + /** |
16 | 16 | * Get a metadata value for the given group and key. |
17 | 17 | * @param $group The group name |
18 | 18 | * @param $key Metadata key |
19 | 19 | * @return String |
20 | 20 | */ |
21 | | - public static function get( $group , $key ) { |
| 21 | + public static function get( $group, $key ) { |
22 | 22 | $dbr = wfGetDB( DB_SLAVE ); |
23 | | - $conds = array( 'tmd_group' => $group , 'tmd_key' => $key ); |
| 23 | + $conds = array( 'tmd_group' => $group, 'tmd_key' => $key ); |
24 | 24 | $result = $dbr->selectField( 'translate_metadata', 'tmd_value', $conds, __METHOD__ ); |
25 | 25 | return $result; |
26 | 26 | } |
27 | | - /* |
| 27 | + |
| 28 | + /** |
28 | 29 | * Set a metadata value for the given group and metadata key. Updates the value if already existing. |
29 | 30 | * @param $group The group name |
30 | 31 | * @param $key Metadata key |
31 | 32 | * @param $value Metadata value |
32 | 33 | */ |
33 | | - public static function set( $group , $key, $value ) { |
| 34 | + public static function set( $group, $key, $value ) { |
34 | 35 | $dbw = wfGetDB( DB_MASTER ); |
35 | | - $data = array( 'tmd_group' => $group , 'tmd_key' => $key, 'tmd_value' => $value ); |
| 36 | + $data = array( 'tmd_group' => $group, 'tmd_key' => $key, 'tmd_value' => $value ); |
36 | 37 | $dbw->replace( 'translate_metadata', array( array( 'tmd_group', 'tmd_key' ) ), $data, __METHOD__ ); |
37 | 38 | } |
38 | 39 | |