Skip to content

Commit f5122a8

Browse files
committed
fix
1 parent dbd0ee5 commit f5122a8

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

src/Entities/Entity.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -95,56 +95,6 @@ public function reflect($object = null)
9595
return $fields;
9696
}
9797

98-
public function reflect($object = null)
99-
{
100-
if ($object == null) {
101-
$object = $this;
102-
}
103-
104-
$reflection = new \ReflectionObject($object);
105-
$properties = $reflection->getProperties();
106-
107-
$fields = [];
108-
109-
foreach ($properties as $property) {
110-
$name = $property->getName();
111-
112-
if ($name == 'bot_name') {
113-
continue;
114-
}
115-
116-
if (!$property->isPrivate()) {
117-
$array_of_obj = false;
118-
if (is_array($object->$name)) {
119-
$array_of_obj = true;
120-
foreach ($object->$name as $elm) {
121-
if (!is_object($elm)) {
122-
$array_of_obj = false;
123-
break;
124-
}
125-
}
126-
}
127-
128-
if (is_object($object->$name)) {
129-
$fields[$name] = $this->reflect($object->$name);
130-
} elseif ($array_of_obj) {
131-
foreach ($object->$name as $elm) {
132-
$fields[$name][] = $this->reflect($elm);
133-
}
134-
} else {
135-
$property->setAccessible(true);
136-
$value = $property->getValue($object);
137-
if (is_null($value)) {
138-
continue;
139-
}
140-
$fields[$name] = $value;
141-
}
142-
}
143-
}
144-
return $fields;
145-
}
146-
147-
14898
public function __toString()
14999
{
150100
return $this->toJson();

0 commit comments

Comments
 (0)