Code Duplication    Length = 8-11 lines in 2 locations

class/PersistableMlObjectHandler.php 2 locations

@@ 42-52 (lines=11) @@
39
        // Create the first part of the SQL query to join the "_text" table
40
        $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->table . '_text AS ' . $this->_itemname . '_text ON ' . $this->_itemname . '.' . $this->keyName . '=' . $this->_itemname . '_text.' . $this->keyName;
41
42
        if ($language) {
43
            // If a language was specified, then let's create a WHERE clause to only return the objects associated with this language
44
45
            // if no criteria was previously created, let's create it
46
            if (!$criteria) {
47
                $criteria = new \CriteriaCompo();
48
            }
49
            $criteria->add(new \Criteria('language', $language));
50
51
            return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
52
        }
53
54
        return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
55
    }
@@ 66-73 (lines=8) @@
63
     */
64
    public function &get($id, $language = false, $as_object = true, $debug = false)
65
    {
66
        if (!$language) {
67
            return parent::get($id, $as_object, $debug);
68
        } else {
69
            $criteria = new \CriteriaCompo();
70
            $criteria->add(new \Criteria('language', $language));
71
72
            return parent::get($id, $as_object, $debug, $criteria);
73
        }
74
    }
75
76
    public function changeTableNameForML()