Skip to content

Commit

Permalink
ignore exception throw by unknown entity property
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Semm committed Apr 1, 2012
1 parent 8327932 commit efe1333
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Doctrine/Mapper/EntityMapper.php
Expand Up @@ -42,7 +42,12 @@ public function toEntity(\ArrayAccess $document, $targetEntity) {

$reflectionClass = new \ReflectionClass($targetEntity);
foreach ($document as $property => $value) {
$classProperty = $reflectionClass->getProperty($this->removeFieldSuffix($property));
try {
$classProperty = $reflectionClass->getProperty($this->removeFieldSuffix($property));
} catch (\ReflectionException $e) {
continue;
}

$classProperty->setAccessible(true);
$classProperty->setValue($targetEntity, $value);
}
Expand Down

0 comments on commit efe1333

Please sign in to comment.