@@ 242-262 (lines=21) @@ | ||
239 | return isset($this->dbRow[$var]); |
|
240 | }*/ |
|
241 | ||
242 | public function set($var, $value) |
|
243 | { |
|
244 | $this->_dbLoadIfNotLoaded(); |
|
245 | ||
246 | /* |
|
247 | // Ok, let's start by checking the column type |
|
248 | $type = $this->db_connection->getColumnType($this->dbTableName, $var); |
|
249 | ||
250 | // Throws an exception if the type is not ok. |
|
251 | if (!$this->db_connection->checkType($value, $type)) { |
|
252 | throw new TDBMException("Error! Invalid value passed for attribute '$var' of table '$this->dbTableName'. Passed '$value', but expecting '$type'"); |
|
253 | } |
|
254 | */ |
|
255 | ||
256 | /*if ($var == $this->getPrimaryKey() && isset($this->dbRow[$var])) |
|
257 | throw new TDBMException("Error! Changing primary key value is forbidden.");*/ |
|
258 | $this->dbRow[$var] = $value; |
|
259 | if ($this->tdbmService !== null && $this->status === TDBMObjectStateEnum::STATE_LOADED) { |
|
260 | $this->status = TDBMObjectStateEnum::STATE_DIRTY; |
|
261 | $this->tdbmService->_addToToSaveObjectList($this); |
|
262 | } |
|
263 | } |
|
264 | ||
265 | /** |
|
@@ 269-276 (lines=8) @@ | ||
266 | * @param string $foreignKeyName |
|
267 | * @param AbstractTDBMObject $bean |
|
268 | */ |
|
269 | public function setRef($foreignKeyName, AbstractTDBMObject $bean = null) |
|
270 | { |
|
271 | $this->references[$foreignKeyName] = $bean; |
|
272 | ||
273 | if ($this->tdbmService !== null && $this->status === TDBMObjectStateEnum::STATE_LOADED) { |
|
274 | $this->status = TDBMObjectStateEnum::STATE_DIRTY; |
|
275 | $this->tdbmService->_addToToSaveObjectList($this); |
|
276 | } |
|
277 | } |
|
278 | ||
279 | /** |