From faae157bfc23c8b279e097b2c9a4388fa4553211 Mon Sep 17 00:00:00 2001 From: corentin Date: Tue, 7 Jun 2016 12:05:43 +0200 Subject: [PATCH] Fixed: isEmpty() return always false --- src/Model/Translatable/TranslationMethods.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Model/Translatable/TranslationMethods.php b/src/Model/Translatable/TranslationMethods.php index a280afca..8e2ce22e 100644 --- a/src/Model/Translatable/TranslationMethods.php +++ b/src/Model/Translatable/TranslationMethods.php @@ -93,6 +93,13 @@ public function getLocale() */ public function isEmpty() { - return false; + foreach (get_object_vars($this) as $var => $value) { + if (in_array($var, array('id', 'translatable', 'locale'))) + continue; + + if (!empty($value)) + return false; + } + return true; } }