| @@ 254-273 (lines=20) @@ | ||
| 251 | $properties = $reflection->getProperties(); |
|
| 252 | ||
| 253 | try { |
|
| 254 | foreach ($properties as $propObj) { |
|
| 255 | $propName = $propObj->name; |
|
| 256 | ||
| 257 | // filter transient attributes |
|
| 258 | if (!in_array($propName, $this->BO->getTransientAttributes())) { |
|
| 259 | $this->BO->set($propName, $row[$propName]); |
|
| 260 | } elseif (!$propObj->isPrivate() && $this->BO->getPropObject($propName) instanceof Relation) { |
|
| 261 | $prop = $this->BO->getPropObject($propName); |
|
| 262 | ||
| 263 | // handle the setting of ONE-TO-MANY relation values |
|
| 264 | if ($prop->getRelationType() == 'ONE-TO-MANY') { |
|
| 265 | $this->BO->set($propObj->name, $this->BO->getOID()); |
|
| 266 | } |
|
| 267 | ||
| 268 | // handle the setting of MANY-TO-ONE relation values |
|
| 269 | if ($prop->getRelationType() == 'MANY-TO-ONE' && isset($row[$propName])) { |
|
| 270 | $this->BO->set($propObj->name, $row[$propName]); |
|
| 271 | } |
|
| 272 | } |
|
| 273 | } |
|
| 274 | } catch (IllegalArguementException $e) { |
|
| 275 | self::$logger->warn('Bad data stored in the table ['.$this->BO->getTableName().'], field ['.$propObj->name.'] bad value['.$row[$propObj->name].'], exception ['.$e->getMessage().']'); |
|
| 276 | } catch (PHPException $e) { |
|
| @@ 254-273 (lines=20) @@ | ||
| 251 | $properties = $reflection->getProperties(); |
|
| 252 | ||
| 253 | try { |
|
| 254 | foreach ($properties as $propObj) { |
|
| 255 | $propName = $propObj->name; |
|
| 256 | ||
| 257 | // filter transient attributes |
|
| 258 | if (!in_array($propName, $this->BO->getTransientAttributes())) { |
|
| 259 | $this->BO->set($propName, $row[$propName]); |
|
| 260 | } elseif (!$propObj->isPrivate() && $this->BO->getPropObject($propName) instanceof Relation) { |
|
| 261 | $prop = $this->BO->getPropObject($propName); |
|
| 262 | ||
| 263 | // handle the setting of ONE-TO-MANY relation values |
|
| 264 | if ($prop->getRelationType() == 'ONE-TO-MANY') { |
|
| 265 | $this->BO->set($propObj->name, $this->BO->getOID()); |
|
| 266 | } |
|
| 267 | ||
| 268 | // handle the setting of MANY-TO-ONE relation values |
|
| 269 | if ($prop->getRelationType() == 'MANY-TO-ONE' && isset($row[$propName])) { |
|
| 270 | $this->BO->set($propObj->name, $row[$propName]); |
|
| 271 | } |
|
| 272 | } |
|
| 273 | } |
|
| 274 | } catch (IllegalArguementException $e) { |
|
| 275 | self::$logger->warn('Bad data stored in the table ['.$this->BO->getTableName().'], field ['.$propObj->name.'] bad value['.$row[$propObj->name].'], exception ['.$e->getMessage().']'); |
|
| 276 | } catch (PHPException $e) { |
|