| Conditions | 3 |
| Paths | 12 |
| Total Lines | 29 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function update($rows, $table) |
||
|
|
|||
| 29 | { |
||
| 30 | $db = Connection::get(); |
||
| 31 | $wqb = new WhereQueryBuilder(); |
||
| 32 | $query = "UPDATE ".$table." SET "; |
||
| 33 | $ar = array(); |
||
| 34 | |||
| 35 | foreach($row as $key => $val){ |
||
| 36 | $ar[':'.$key] = $val; |
||
| 37 | $query.= $this->quote($key)." =:".$key.","; |
||
| 38 | } |
||
| 39 | |||
| 40 | $query = rtrim($query, ","); |
||
| 41 | |||
| 42 | try{ |
||
| 43 | $whereQuery = $wqb->buildAllWhereQuery( |
||
| 44 | $this->where, |
||
| 45 | $this->whereRaw, |
||
| 46 | $this->whereIn, |
||
| 47 | $this->whereNotIn, |
||
| 48 | $this->whereNull, |
||
| 49 | $this->whereNotNull |
||
| 50 | ); |
||
| 51 | $query.= " ".join(" ", $whereQuery); |
||
| 52 | $stmt = Connection::get()->prepare($this->queryPrefix($query)); |
||
| 53 | $stmt->execute($ar); |
||
| 54 | $this->reset(); |
||
| 55 | } catch(Exception $e){ |
||
| 56 | throw new Exception($e->getMessage()); |
||
| 57 | } |
||
| 60 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.