Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 18 |
Ratio | 100 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | View Code Duplication | private function processFindCarts($cart, $cust) |
|
31 | { |
||
32 | $sql = 'SELECT DISTINCT pc.id_cart as id, DATE_FORMAT(pc.date_upd,"%a %D %b %Y, %l:%i %p") as timer from '._DB_PREFIX_.'cart as pc |
||
33 | LEFT JOIN '._DB_PREFIX_.'cart_product as pcp on pcp.id_cart = pc.id_cart |
||
34 | WHERE pc.id_cart NOT IN (SELECT po.id_cart FROM '._DB_PREFIX_.'orders as po) |
||
35 | AND pcp.id_product IS NOT NULL |
||
36 | AND pc.id_customer = '.(int) $cust.' |
||
37 | AND pc.id_cart != '.(int) $cart.' |
||
38 | ORDER BY pc.date_upd DESC |
||
39 | LIMIT 10'; |
||
40 | if ($results = $this->dbConn->fetchRowMany($sql)) { |
||
41 | foreach ($results as &$row) { |
||
42 | $row['token'] = md5(_COOKIE_KEY_.'recover_cart_'.$row['id']); |
||
43 | } |
||
44 | |||
45 | return $results; |
||
46 | } |
||
47 | } |
||
48 | |||
49 | } |
Overwriting private methods is generally fine as long as you also use private visibility. It might still be preferable for understandability to use a different method name.