X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fpq-gateway;a=blobdiff_plain;f=lib%2Fpq%2FMapper%2FProperty%2FAll.php;h=02855fd279a678c5a76ebe536991a4c76d20f3c7;hp=6eb49457645c246efb91c41d63b4a2e170e52b46;hb=0a6fac6b260383a6abea76804410273c7b8b630b;hpb=a9b40ffbef4f2280ad0233dbde1d99d057bcc1fa diff --git a/lib/pq/Mapper/Property/All.php b/lib/pq/Mapper/Property/All.php index 6eb4945..02855fd 100644 --- a/lib/pq/Mapper/Property/All.php +++ b/lib/pq/Mapper/Property/All.php @@ -44,13 +44,13 @@ class All implements RefPropertyInterface * @return callable deferred callback */ function write($object, Row $rowToUpdate) { - $property = $this->findRefProperty($object); - $map = $this->mapper->mapOf($this->refClass); if (($refs = $this->extract($object))) { + $property = $this->findRefProperty($object); foreach ($refs as $ref) { $property->assign($ref, $object); } - return function() use($map, $refs) { + return function() use($refs) { + $map = $this->mapper->mapOf($this->refClass); foreach ($refs as $ref) { $map->unmap($ref); }