Code Duplication    Length = 21-21 lines in 2 locations

src/model/SelectQuery.php 1 location

@@ 19-39 (lines=21) @@
16
    /**
17
     * @inheritdoc
18
     */
19
    public function getSQL()
20
    {
21
        $select = "SELECT " . $this->buildReturnVars();
22
23
        $from = "\nFROM " . $this->buildNodes();
24
25
        $where = count($this->conditions)
26
            ? "\nWHERE " . $this->buildConditions()
27
            : ''; // no conditions present
28
29
        $order = count($this->order)
30
            ? "\nORDER BY " . $this->buildOrderTerms()
31
            : ''; // no order terms
32
33
        $limit = $this->limit !== null
34
            ? "\nLIMIT {$this->limit}"
35
            . ($this->offset !== null ? " OFFSET {$this->offset}" : '')
36
            : ''; // no limit or offset
37
38
        return "{$select}{$from}{$where}{$order}{$limit}";
39
    }
40
41
    /**
42
     * @ignore string magic (enables creation of nested SELECT queries)

src/model/UpdateQuery.php 1 location

@@ 89-109 (lines=21) @@
86
    /**
87
     * @inheritdoc
88
     */
89
    public function getSQL()
90
    {
91
        $update = "UPDATE " . $this->buildNodes();
92
93
        $set = "\nSET " . implode(",\n    ", $this->assignments);
94
95
        $where = count($this->conditions)
96
            ? "\nWHERE " . $this->buildConditions()
97
            : ''; // no conditions present
98
99
        $order = count($this->order)
100
            ? "\nORDER BY " . $this->buildOrderTerms()
101
            : ''; // no order terms
102
103
        $limit = $this->limit !== null
104
            ? "\nLIMIT {$this->limit}"
105
            . ($this->offset !== null ? " OFFSET {$this->offset}" : '')
106
            : ''; // no limit or offset
107
108
        return "{$update}{$set}{$where}{$order}{$limit}";
109
    }
110
111
    /**
112
     * @param Column $column