| @@ 83-90 (lines=8) @@ | ||
| 80 | return null; |
|
| 81 | } |
|
| 82 | ||
| 83 | if (is_array($fields) && count($fields)) { |
|
| 84 | if (!in_array('o.' . $this->handler->keyName, $fields)) { |
|
| 85 | $fields[] = 'o.' . $this->handler->keyName; |
|
| 86 | } |
|
| 87 | $select = implode(',', $fields); |
|
| 88 | } else { |
|
| 89 | $select = 'o.*, l.*'; |
|
| 90 | } |
|
| 91 | $limit = null; |
|
| 92 | $start = null; |
|
| 93 | // $field_object = empty($field_object) ? $field_link : $field_object; |
|
| @@ 42-49 (lines=8) @@ | ||
| 39 | */ |
|
| 40 | public function &getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true) |
|
| 41 | { |
|
| 42 | if (is_array($fields) && count($fields) > 0) { |
|
| 43 | if (!in_array($this->handler->keyName, $fields)) { |
|
| 44 | $fields[] = $this->handler->keyName; |
|
| 45 | } |
|
| 46 | $select = '`' . implode('`, `', $fields) . '`'; |
|
| 47 | } else { |
|
| 48 | $select = '*'; |
|
| 49 | } |
|
| 50 | $limit = null; |
|
| 51 | $start = null; |
|
| 52 | $sql = "SELECT {$select} FROM `{$this->handler->table}`"; |
|
| @@ 1329-1336 (lines=8) @@ | ||
| 1326 | ||
| 1327 | return $object; |
|
| 1328 | } |
|
| 1329 | if (is_array($fields) && count($fields) > 0) { |
|
| 1330 | $select = implode(',', $fields); |
|
| 1331 | if (!in_array($this->keyName, $fields)) { |
|
| 1332 | $select .= ', ' . $this->keyName; |
|
| 1333 | } |
|
| 1334 | } else { |
|
| 1335 | $select = '*'; |
|
| 1336 | } |
|
| 1337 | $sql = sprintf('SELECT %s FROM %s WHERE %s = %s', $select, $this->table, $this->keyName, $this->db->quote($id)); |
|
| 1338 | //$sql = "SELECT {$select} FROM {$this->table} WHERE {$this->keyName} = " . $this->db->quote($id); |
|
| 1339 | if (!$result = $this->db->query($sql)) { |
|