From 3905332ef0d92282716acb1c634d290ac675e756 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 6 Nov 2010 12:42:46 +0100 Subject: [PATCH] Take into account PlExportable interface. Signed-off-by: Florent Bruneau --- classes/pldbtableentry.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/pldbtableentry.php b/classes/pldbtableentry.php index 466a4ff..bb92f82 100644 --- a/classes/pldbtableentry.php +++ b/classes/pldbtableentry.php @@ -223,7 +223,11 @@ class JSonFieldFormatter implements PlDBTableFieldFormatter, ArrayAccess if (is_string($data)) { $this->data = json_decode($data, true); } else if (is_object($data)) { - $this->data = json_decode(json_encode($data), true); + if ($data instanceof PlExportable) { + $this->data = $data->export(); + } else { + $this->data = json_decode(json_encode($data), true); + } } else if (is_array($data)) { $this->data = $data; } -- 2.1.4