Code Duplication    Length = 8-23 lines in 2 locations

src/Mouf/Database/TDBM/DbRow.php 2 locations

@@ 221-243 (lines=23) @@
218
		return isset($this->dbRow[$var]);
219
	}*/
220
	
221
	public function set($var, $value) {
222
		$this->_dbLoadIfNotLoaded();
223
224
		/*
225
		// Ok, let's start by checking the column type
226
		$type = $this->db_connection->getColumnType($this->dbTableName, $var);
227
228
		// Throws an exception if the type is not ok.
229
		if (!$this->db_connection->checkType($value, $type)) {
230
			throw new TDBMException("Error! Invalid value passed for attribute '$var' of table '$this->dbTableName'. Passed '$value', but expecting '$type'");
231
		}
232
		*/
233
234
		/*if ($var == $this->getPrimaryKey() && isset($this->dbRow[$var]))
235
			throw new TDBMException("Error! Changing primary key value is forbidden.");*/
236
		$this->dbRow[$var] = $value;
237
		if ($this->tdbmService !== null && $this->status === TDBMObjectStateEnum::STATE_LOADED) {
238
			$this->status = TDBMObjectStateEnum::STATE_DIRTY;
239
			$this->tdbmService->_addToToSaveObjectList($this);
240
		}
241
		// Unset the error since something has changed (Insert or Update could work this time).
242
		$this->db_onerror = false;
243
	}
244
245
	/**
246
	 * @param string $foreignKeyName
@@ 249-256 (lines=8) @@
246
	 * @param string $foreignKeyName
247
	 * @param AbstractTDBMObject $bean
248
	 */
249
	public function setRef($foreignKeyName, AbstractTDBMObject $bean = null) {
250
		$this->references[$foreignKeyName] = $bean;
251
252
        if ($this->tdbmService !== null && $this->status === TDBMObjectStateEnum::STATE_LOADED) {
253
            $this->status = TDBMObjectStateEnum::STATE_DIRTY;
254
            $this->tdbmService->_addToToSaveObjectList($this);
255
        }
256
	}
257
258
    /**
259
     * @param string $foreignKeyName A unique name for this reference