@@ -6,6 +6,10 @@ |
||
6 | 6 | public static $idField = 'BUDDY_ID'; |
7 | 7 | |
8 | 8 | // TODO - remove public static function db_buddy_update_status($buddy_id, $status) { |
9 | + |
|
10 | + /** |
|
11 | + * @param integer $status |
|
12 | + */ |
|
9 | 13 | public function db_buddy_update_status($status) { |
10 | 14 | $buddy_id = idval($this->row['BUDDY_ID']); |
11 | 15 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | ->setIdField($object::$idField) |
14 | 14 | ->field('*') |
15 | 15 | ->from($object::$tableName) |
16 | - ->where($object::$idField . ' = "' . $rowId . '"'); |
|
16 | + ->where($object::$idField.' = "'.$rowId.'"'); |
|
17 | 17 | |
18 | 18 | $object->row = $stmt->selectRow(); |
19 | 19 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param Entity $object |
25 | 25 | */ |
26 | 26 | public function deleteById($object) { |
27 | - classSupernova::$gc->db->doquery("DELETE FROM `{{" . $object::$tableName . "}}` WHERE `{$object::$idField}` = '{$object->row[$object::$idField]}' LIMIT 1;"); |
|
27 | + classSupernova::$gc->db->doquery("DELETE FROM `{{".$object::$tableName."}}` WHERE `{$object::$idField}` = '{$object->row[$object::$idField]}' LIMIT 1;"); |
|
28 | 28 | |
29 | 29 | return classSupernova::$gc->db->db_affected_rows(); |
30 | 30 | } |
@@ -35,18 +35,18 @@ |
||
35 | 35 | // TODO - move to reader ???????? |
36 | 36 | public function insert() { |
37 | 37 | $query = array(); |
38 | - foreach($this->row as $fieldName => $fieldValue) { |
|
38 | + foreach ($this->row as $fieldName => $fieldValue) { |
|
39 | 39 | $fieldValue = self::$dbStatic->db_escape($fieldValue); |
40 | 40 | $query[] = "`{$fieldName}` = '{$fieldValue}'"; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $query = implode(',', $query); |
44 | - if(empty($query)) { |
|
44 | + if (empty($query)) { |
|
45 | 45 | // TODO Exceptiion |
46 | 46 | return 0; |
47 | 47 | } |
48 | 48 | |
49 | - self::$dbStatic->doquery("INSERT INTO `{{" . static::$tableName . "}}` SET " . $query); |
|
49 | + self::$dbStatic->doquery("INSERT INTO `{{".static::$tableName."}}` SET ".$query); |
|
50 | 50 | |
51 | 51 | // TODO Exceptiion if result is empty |
52 | 52 | return $this->row[static::$idField] = self::$dbStatic->db_insert_id(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * |
10 | 10 | * Idea from buddy.php Created by Perberos. All rights reversed (C) 2006 |
11 | 11 | * */ |
12 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
12 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
13 | 13 | |
14 | 14 | class_exists('Buddy'); |
15 | 15 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // Checking for user ID - in case if it was request from outside buddy system |
53 | 53 | $new_friend_id_safe = sys_get_param_id('request_user_id'); |
54 | 54 | $new_friend_name = sys_get_param_str_unsafe('request_user_name'); |
55 | - if($new_friend_id_safe || $new_friend_name) { |
|
55 | + if ($new_friend_id_safe || $new_friend_name) { |
|
56 | 56 | sn_db_transaction_start(); |
57 | 57 | $buddy = classSupernova::$gc->buddy; |
58 | 58 | $new_request_text = sys_get_param_str('request_text'); |