We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3e4b69 commit 4936d59Copy full SHA for 4936d59
src/Mapping/Extraction/Extractor.php
@@ -14,6 +14,9 @@
14
*/
15
class Extractor
16
{
17
+ private $lastObjectType = '';
18
+ private $fields = [];
19
+
20
/**
21
* @param $object
22
* @return Entity
@@ -50,8 +53,14 @@ private function getFields($object): array
50
53
51
54
public function extract($object, $ignoreFilter = false): array
52
55
- $fields = $this->getFields($object);
56
+ if(get_class($object) != $this->lastObjectType)
57
+ {
58
+ $this->fields = $this->getFields($object);
59
+ $this->lastObjectType = get_class($object);
60
+ }
61
62
$reflection = new \ReflectionObject($object);
63
+ $fields = &$this->fields;
64
$array = [];
65
66
foreach ($fields as $field) {
0 commit comments