Code Duplication    Length = 8-8 lines in 3 locations

htdocs/class/model/joint.php 1 location

@@ 82-89 (lines=8) @@
79
            return null;
80
        }
81
82
        if (is_array($fields) && count($fields)) {
83
            if (!in_array('o.' . $this->handler->keyName, $fields)) {
84
                $fields[] = 'o.' . $this->handler->keyName;
85
            }
86
            $select = implode(',', $fields);
87
        } else {
88
            $select = 'o.*, l.*';
89
        }
90
        $limit = null;
91
        $start = null;
92
        // $field_object = empty($field_object) ? $field_link : $field_object;

htdocs/class/model/read.php 1 location

@@ 41-48 (lines=8) @@
38
     */
39
    public function &getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true)
40
    {
41
        if (is_array($fields) && count($fields) > 0) {
42
            if (!in_array($this->handler->keyName, $fields)) {
43
                $fields[] = $this->handler->keyName;
44
            }
45
            $select = '`' . implode('`, `', $fields) . '`';
46
        } else {
47
            $select = '*';
48
        }
49
        $limit = null;
50
        $start = null;
51
        $sql   = "SELECT {$select} FROM `{$this->handler->table}`";

htdocs/kernel/object.php 1 location

@@ 1370-1377 (lines=8) @@
1367
1368
            return $object;
1369
        }
1370
        if (is_array($fields) && count($fields) > 0) {
1371
            $select = implode(',', $fields);
1372
            if (!in_array($this->keyName, $fields)) {
1373
                $select .= ', ' . $this->keyName;
1374
            }
1375
        } else {
1376
            $select = '*';
1377
        }
1378
        $sql = sprintf('SELECT %s FROM %s WHERE %s = %s', $select, $this->table, $this->keyName, $this->db->quote($id));
1379
        //$sql = "SELECT {$select} FROM {$this->table} WHERE {$this->keyName} = " . $this->db->quote($id);
1380
        if (!$result = $this->db->query($sql)) {