| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | private function processFindCarts($cart, $cust) |
||
| 29 | { |
||
| 30 | $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 |
||
| 31 | LEFT JOIN '._DB_PREFIX_.'cart_product as pcp on pcp.id_cart = pc.id_cart |
||
| 32 | WHERE pc.id_cart NOT IN (SELECT po.id_cart FROM '._DB_PREFIX_.'orders as po) |
||
| 33 | AND pcp.id_product IS NOT NULL |
||
| 34 | AND pc.id_customer = '.(int) $cust.' |
||
| 35 | AND pc.id_cart != '.(int) $cart.' |
||
| 36 | ORDER BY pc.date_upd DESC |
||
| 37 | LIMIT 10'; |
||
| 38 | if ($results = $this->dbConn->fetchRowMany($sql)) { |
||
|
|
|||
| 39 | foreach ($results as &$row) { |
||
| 40 | $row['token'] = md5(_COOKIE_KEY_.'recover_cart_'.$row['id']); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $results; |
||
| 44 | } else { |
||
| 45 | return; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: