projects
/
m6w6
/
pq-gateway
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
map test
[m6w6/pq-gateway]
/
lib
/
pq
/
Mapper
/
Property
/
All.php
diff --git
a/lib/pq/Mapper/Property/All.php
b/lib/pq/Mapper/Property/All.php
index 49fb0a622b4310a9ed410ee316362b62aeb6658c..6eb49457645c246efb91c41d63b4a2e170e52b46 100644
(file)
--- a/
lib/pq/Mapper/Property/All.php
+++ b/
lib/pq/Mapper/Property/All.php
@@
-46,15
+46,16
@@
class All implements RefPropertyInterface
function write($object, Row $rowToUpdate) {
$property = $this->findRefProperty($object);
$map = $this->mapper->mapOf($this->refClass);
function write($object, Row $rowToUpdate) {
$property = $this->findRefProperty($object);
$map = $this->mapper->mapOf($this->refClass);
- $refs = $this->extract($object);
- foreach ($refs as $ref) {
- $property->assign($ref, $object);
- }
- return function() use($map, $refs) {
+ if (($refs = $this->extract($object))) {
foreach ($refs as $ref) {
foreach ($refs as $ref) {
- $
map->unmap($ref
);
+ $
property->assign($ref, $object
);
}
}
- };
+ return function() use($map, $refs) {
+ foreach ($refs as $ref) {
+ $map->unmap($ref);
+ }
+ };
+ }
}
/**
}
/**