Code Duplication    Length = 9-22 lines in 2 locations

src/DbRow.php 2 locations

@@ 207-228 (lines=22) @@
204
        return isset($this->dbRow[$var]);
205
    }*/
206
207
    public function set($var, $value)
208
    {
209
        $this->_dbLoadIfNotLoaded();
210
211
        /*
212
        // Ok, let's start by checking the column type
213
        $type = $this->db_connection->getColumnType($this->dbTableName, $var);
214
215
        // Throws an exception if the type is not ok.
216
        if (!$this->db_connection->checkType($value, $type)) {
217
            throw new TDBMException("Error! Invalid value passed for attribute '$var' of table '$this->dbTableName'. Passed '$value', but expecting '$type'");
218
        }
219
        */
220
221
        /*if ($var == $this->getPrimaryKey() && isset($this->dbRow[$var]))
222
            throw new TDBMException("Error! Changing primary key value is forbidden.");*/
223
        $this->dbRow[$var] = $value;
224
        if ($this->tdbmService !== null && $this->status === TDBMObjectStateEnum::STATE_LOADED) {
225
            $this->status = TDBMObjectStateEnum::STATE_DIRTY;
226
            $this->tdbmService->_addToToSaveObjectList($this);
227
        }
228
    }
229
230
    /**
231
     * @param string             $foreignKeyName
@@ 234-242 (lines=9) @@
231
     * @param string             $foreignKeyName
232
     * @param AbstractTDBMObject $bean
233
     */
234
    public function setRef($foreignKeyName, AbstractTDBMObject $bean = null)
235
    {
236
        $this->references[$foreignKeyName] = $bean;
237
238
        if ($this->tdbmService !== null && $this->status === TDBMObjectStateEnum::STATE_LOADED) {
239
            $this->status = TDBMObjectStateEnum::STATE_DIRTY;
240
            $this->tdbmService->_addToToSaveObjectList($this);
241
        }
242
    }
243
244
    /**
245
     * @param string $foreignKeyName A unique name for this reference