Code Duplication    Length = 6-7 lines in 2 locations

src/Model.php 2 locations

@@ 170-175 (lines=6) @@
167
    {
168
        $bindNameParameters = [];
169
        $sqlUpdate = 'UPDATE '.$this->getTableName().' SET ';
170
        foreach ($this->properties as $columnName => $columnValue) {
171
            if ($columnName == 'id') {
172
                continue;
173
            }
174
            $bindColumnName = ':'.$columnName;
175
            $sqlUpdate .= "$columnName = $bindColumnName,";
176
            $bindNameParameters[$bindColumnName] = $columnValue;
177
        }
178
        //Remove the last comma in sql command then join it to the other query part.
@@ 198-204 (lines=7) @@
195
        $columnValues = '';
196
        $bindNameParameters = [];
197
        $sqlCreate = 'INSERT'.' INTO '.$this->getTableName().' (';
198
        foreach ($this->properties as $columnName => $columnValue) {
199
            $bindColumnName = ':'.$columnName;
200
            $columnNames .= $columnName.',';
201
            $columnValues .= $bindColumnName.',';
202
            $bindNameParameters[$bindColumnName] = $columnValue;
203
        }
204
        // Remove ending comma and whitespace.
205
        $columnNames = substr($columnNames, 0, -1);
206
        $columnValues = substr($columnValues, 0, -1);
207