Skip to content

Commit

Permalink
Merge pull request #332 from Headoo/master
Browse files Browse the repository at this point in the history
Fix: isEmpty() return true if it's empty
  • Loading branch information
cursedcoder authored Oct 12, 2016
2 parents ad45a31 + 3aa0af8 commit 1113f4f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Model/Translatable/TranslationMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ public function getLocale()
*/
public function isEmpty()
{
return false;
foreach (get_object_vars($this) as $var => $value) {
if (in_array($var, ['id', 'translatable', 'locale'])) {
continue;
}

if (!empty($value)) {
return false;
}
}

return true;
}
}

0 comments on commit 1113f4f

Please sign in to comment.