Skip to content

Commit

Permalink
LeanEngine: Preserve __type field in hook functions
Browse files Browse the repository at this point in the history
  • Loading branch information
juvenn committed May 6, 2016
1 parent 1abdb9a commit 09e0498
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LeanCloud/Engine/LeanEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@ private function parsePlainBody($body) {
true;
$this->env["useMaster"] = false;
// remove internal fields set by API
// note we need to preserve `__type` field for object decoding
// see #61
forEach($data as $key) {
if ($key[0] === "_") {
if ($key[0] === "_" && $key[1] !== "_") {
unset($data[$key]);
}
}
Expand Down

0 comments on commit 09e0498

Please sign in to comment.